提交 c58fe353 编写于 作者: H Hui Li

Merge branch 'develop' into hotfix/lihui

...@@ -21,7 +21,7 @@ TDengine is an open-sourced big data platform under [GNU AGPL v3.0](http://www.g ...@@ -21,7 +21,7 @@ TDengine is an open-sourced big data platform under [GNU AGPL v3.0](http://www.g
- **Zero Management, No Learning Curve**: It takes only seconds to download, install, and run it successfully; there are no other dependencies. Automatic partitioning on tables or DBs. Standard SQL is used, with C/C++, Python, JDBC, Go and RESTful connectors. - **Zero Management, No Learning Curve**: It takes only seconds to download, install, and run it successfully; there are no other dependencies. Automatic partitioning on tables or DBs. Standard SQL is used, with C/C++, Python, JDBC, Go and RESTful connectors.
# Documentation # Documentation
For user manual, system design and architecture, engineering blogs, refer to [TDengine Documentation](https://www.taosdata.com/en/documentation/) For user manual, system design and architecture, engineering blogs, refer to [TDengine Documentation](https://www.taosdata.com/en/documentation/)(中文版请点击[这里](https://www.taosdata.com/cn/documentation20/))
for details. The documentation from our website can also be downloaded locally from *documentation/tdenginedocs-en* or *documentation/tdenginedocs-cn*. for details. The documentation from our website can also be downloaded locally from *documentation/tdenginedocs-en* or *documentation/tdenginedocs-cn*.
# Building # Building
......
...@@ -119,7 +119,7 @@ WantedBy=multi-user.target ...@@ -119,7 +119,7 @@ WantedBy=multi-user.target
return nil return nil
} }
const version = "TDengine alert v1.0.0" const version = "TDengine alert v2.0.0.0"
func main() { func main() {
var ( var (
......
...@@ -5,7 +5,7 @@ go 1.14 ...@@ -5,7 +5,7 @@ go 1.14
require ( require (
github.com/jmoiron/sqlx v1.2.0 github.com/jmoiron/sqlx v1.2.0
github.com/mattn/go-sqlite3 v2.0.3+incompatible github.com/mattn/go-sqlite3 v2.0.3+incompatible
github.com/taosdata/driver-go master github.com/taosdata/driver-go v0.0.0-20200727182616-1a3b1941c206
go.uber.org/zap v1.14.1 go.uber.org/zap v1.14.1
google.golang.org/appengine v1.6.5 // indirect google.golang.org/appengine v1.6.5 // indirect
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c
......
set -e set -e
# releash.sh -c [arm | arm64 | x64 | x86] # releash.sh -c [armv6l | arm64 | amd64 | 386]
# -o [linux | darwin | windows] # -o [linux | darwin | windows]
# set parameters by default value # set parameters by default value
cpuType=x64 # [arm | arm64 | x64 | x86] cpuType=amd64 # [armv6l | arm64 | amd64 | 386]
osType=linux # [linux | darwin | windows] osType=linux # [linux | darwin | windows]
declare -A archMap=(["armv6l"]="arm" ["arm64"]="arm64" ["amd64"]="x64" ["386"]="x86")
while getopts "h:c:o:" arg while getopts "h:c:o:" arg
do do
case $arg in case $arg in
...@@ -19,7 +20,7 @@ do ...@@ -19,7 +20,7 @@ do
osType=$(echo $OPTARG) osType=$(echo $OPTARG)
;; ;;
h) h)
echo "Usage: `basename $0` -c [arm | arm64 | x64 | x86] -o [linux | darwin | windows]" echo "Usage: `basename $0` -c [armv6l | arm64 | amd64 | 386] -o [linux | darwin | windows]"
exit 0 exit 0
;; ;;
?) #unknown option ?) #unknown option
...@@ -35,6 +36,7 @@ scriptdir=$(dirname $(readlink -f $0)) ...@@ -35,6 +36,7 @@ scriptdir=$(dirname $(readlink -f $0))
cd ${scriptdir}/cmd/alert cd ${scriptdir}/cmd/alert
version=$(grep 'const version =' main.go | awk '{print $NF}') version=$(grep 'const version =' main.go | awk '{print $NF}')
version=${version%\"} version=${version%\"}
version=${version:1}
echo "cpuType=${cpuType}" echo "cpuType=${cpuType}"
echo "osType=${osType}" echo "osType=${osType}"
...@@ -42,4 +44,4 @@ echo "version=${version}" ...@@ -42,4 +44,4 @@ echo "version=${version}"
GOOS=${osType} GOARCH=${cpuType} go build GOOS=${osType} GOARCH=${cpuType} go build
GZIP=-9 tar -zcf ${startdir}/tdengine-alert-${version}-${osType}-${cpuType}.tar.gz alert alert.cfg install_driver.sh driver/ tar -I 'gzip -9' -cf ${startdir}/TDengine-alert-${version}-${osType^}-${archMap[${cpuType}]}.tar.gz alert alert.cfg install_driver.sh driver/
...@@ -13,6 +13,14 @@ CREATE DATABASE power KEEP 365 DAYS 10 REPLICA 3 BLOCKS 4; ...@@ -13,6 +13,14 @@ CREATE DATABASE power KEEP 365 DAYS 10 REPLICA 3 BLOCKS 4;
``` ```
上述语句将创建一个名为power的库,这个库的数据将保留365天(超过365天将被自动删除),每10天一个数据文件,副本数为3, 内存块数为4。详细的语法及参数请见<a href="https://www.taosdata.com/cn/documentation20/taos-sql/">TAOS SQL</a> 上述语句将创建一个名为power的库,这个库的数据将保留365天(超过365天将被自动删除),每10天一个数据文件,副本数为3, 内存块数为4。详细的语法及参数请见<a href="https://www.taosdata.com/cn/documentation20/taos-sql/">TAOS SQL</a>
创建库之后,需要使用SQL命令USE将当前库切换过来,例如:
```cmd
USE power;
```
就当前链接里操作的库换为power,否则对具体表操作前,需要使用“库名.表名”来指定库的名字。
**注意:** **注意:**
- 任何一张表或超级表是属于一个库的,在创建表之前,必须先创建库。 - 任何一张表或超级表是属于一个库的,在创建表之前,必须先创建库。
......
...@@ -39,7 +39,7 @@ Raw DataSize = numOfTables * rowSizePerTable * rowsPerTable ...@@ -39,7 +39,7 @@ Raw DataSize = numOfTables * rowSizePerTable * rowsPerTable
用户可以通过参数keep,设置数据在磁盘中的最大保存时长。为进一步减少存储成本,TDengine还提供多级存储,最冷的数据可以存放在最廉价的存储介质上,应用的访问不用做任何调整,只是读取速度降低了。 用户可以通过参数keep,设置数据在磁盘中的最大保存时长。为进一步减少存储成本,TDengine还提供多级存储,最冷的数据可以存放在最廉价的存储介质上,应用的访问不用做任何调整,只是读取速度降低了。
为提高速度,可以配置多快硬盘,这样可以并发写入或读取数据。 为提高速度,可以配置多快硬盘,这样可以并发写入或读取数据。需要提醒的是,TDengine采取多副本的方式提供数据的高可靠,因此不再需要采用昂贵的磁盘阵列。
### 物理机或虚拟机台数 ### 物理机或虚拟机台数
...@@ -152,19 +152,19 @@ TDengine系统的前台交互客户端应用程序为taos,它与taosd共享同 ...@@ -152,19 +152,19 @@ TDengine系统的前台交互客户端应用程序为taos,它与taosd共享同
系统管理员可以在CLI界面里添加、删除用户,也可以修改密码。CLI里SQL语法如下: 系统管理员可以在CLI界面里添加、删除用户,也可以修改密码。CLI里SQL语法如下:
``` ```
CREATE USER user_name PASS ‘password’; CREATE USER <user_name> PASS <‘password’>;
``` ```
创建用户,并指定用户名和密码,密码需要用单引号引起来 创建用户,并指定用户名和密码,密码需要用单引号引起来
``` ```
DROP USER user_name; DROP USER <user_name>;
``` ```
删除用户,限root用户使用 删除用户,限root用户使用
``` ```
ALTER USER user_name PASS ‘password’; ALTER USER <user_name> PASS <‘password’>;
``` ```
修改用户密码, 为避免被转换为小写,密码需要用单引号引用 修改用户密码, 为避免被转换为小写,密码需要用单引号引用
...@@ -173,7 +173,9 @@ ALTER USER user_name PASS ‘password’; ...@@ -173,7 +173,9 @@ ALTER USER user_name PASS ‘password’;
SHOW USERS; SHOW USERS;
``` ```
显示所有用户 显示所有用户
**注意:**SQL 语法中,< >表示需要用户输入的部分,但请不要输入< >本身
## 数据导入 ## 数据导入
......
...@@ -88,19 +88,20 @@ remote_write: ...@@ -88,19 +88,20 @@ remote_write:
### 查询prometheus写入数据 ### 查询prometheus写入数据
prometheus产生的数据格式如下: prometheus产生的数据格式如下:
``` ```json
{ {
Timestamp: 1576466279341, Timestamp: 1576466279341,
Value: 37.000000, Value: 37.000000,
apiserver_request_latencies_bucket { apiserver_request_latencies_bucket {
component="apiserver", component="apiserver",
instance="192.168.99.116:8443", instance="192.168.99.116:8443",
job="kubernetes-apiservers", job="kubernetes-apiservers",
le="125000", le="125000",
resource="persistentvolumes", s resource="persistentvolumes", s
cope="cluster", cope="cluster",
verb="LIST", verb="LIST",
version=“v1" version=“v1"
}
} }
``` ```
其中,apiserver_request_latencies_bucket为prometheus采集的时序数据的名称,后面{}中的为该时序数据的标签。blm_prometheus会以时序数据的名称在TDengine中自动创建一个超级表,并将{}中的标签转换成TDengine的tag值,Timestamp作为时间戳,value作为该时序数据的值。因此在TDengine的客户端中,可以通过以下指令查到这个数据是否成功写入。 其中,apiserver_request_latencies_bucket为prometheus采集的时序数据的名称,后面{}中的为该时序数据的标签。blm_prometheus会以时序数据的名称在TDengine中自动创建一个超级表,并将{}中的标签转换成TDengine的tag值,Timestamp作为时间戳,value作为该时序数据的值。因此在TDengine的客户端中,可以通过以下指令查到这个数据是否成功写入。
...@@ -184,7 +185,7 @@ url = "http://10.1.2.3:8089/telegraf" ...@@ -184,7 +185,7 @@ url = "http://10.1.2.3:8089/telegraf"
### 查询telegraf写入数据 ### 查询telegraf写入数据
telegraf产生的数据格式如下: telegraf产生的数据格式如下:
``` ```json
{ {
"fields": { "fields": {
"usage_guest": 0, "usage_guest": 0,
......
...@@ -110,6 +110,7 @@ func writeDataImp(wInfo *WriteInfo, wg *sync.WaitGroup, arguments *ProArgs) { ...@@ -110,6 +110,7 @@ func writeDataImp(wInfo *WriteInfo, wg *sync.WaitGroup, arguments *ProArgs) {
Addr: arguments.host, Addr: arguments.host,
Username: arguments.username, Username: arguments.username,
Password: arguments.password, Password: arguments.password,
Timeout: 300 * time.Second,
}) })
if err != nil { if err != nil {
...@@ -220,6 +221,7 @@ func readData(arguments *ProArgs) { ...@@ -220,6 +221,7 @@ func readData(arguments *ProArgs) {
Addr: arguments.host, Addr: arguments.host,
Username: arguments.username, Username: arguments.username,
Password: arguments.password, Password: arguments.password,
Timeout: 300 * time.Second,
}) })
if err != nil { if err != nil {
......
...@@ -18,8 +18,8 @@ sql create table if not exists db.win_cpu(ts timestamp,f_percent_dpc_time double ...@@ -18,8 +18,8 @@ sql create table if not exists db.win_cpu(ts timestamp,f_percent_dpc_time double
print =============== step2 - auto create print =============== step2 - auto create
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'import into db.win_cpu_windows_1_processor using db.win_cpu tags('windows','1','Processor') values(1564641722000,0.000000,95.598305,0.000000,0.000000,0.000000,0.000000);' 127.0.0.1:6020/rest/sql system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'import into db.win_cpu_windows_1_processor using db.win_cpu tags('windows','1','Processor') values(1564641722000,0.000000,95.598305,0.000000,0.000000,0.000000,0.000000);' 127.0.0.1:6041/rest/sql
print curl 127.0.0.1:6020/rest/sql -----> $system_content print curl 127.0.0.1:6041/rest/sql -----> $system_content
#if $system_content != @{"status":"succ","head":["ts","i"],"data":[["2017-12-25 21:28:41.022",1],["2017-12-25 21:28:42.022",2],["2017-12-25 21:28:43.022",3],["2017-12-25 21:28:44.022",4],["2017-12-25 21:28:45.022",5],["2017-12-25 21:28:46.022",6],["2017-12-25 21:28:47.022",7],["2017-12-25 21:28:48.022",8],["2017-12-25 21:28:49.022",9],["2017-12-25 21:28:50.022",10],["2017-12-25 21:28:51.022",11]],"rows":11}@ then #if $system_content != @{"status":"succ","head":["ts","i"],"data":[["2017-12-25 21:28:41.022",1],["2017-12-25 21:28:42.022",2],["2017-12-25 21:28:43.022",3],["2017-12-25 21:28:44.022",4],["2017-12-25 21:28:45.022",5],["2017-12-25 21:28:46.022",6],["2017-12-25 21:28:47.022",7],["2017-12-25 21:28:48.022",8],["2017-12-25 21:28:49.022",9],["2017-12-25 21:28:50.022",10],["2017-12-25 21:28:51.022",11]],"rows":11}@ then
# return -1 # return -1
#endi #endi
......
...@@ -52,50 +52,50 @@ sql insert into t3 values('2017-12-25 21:27:41', 3) ...@@ -52,50 +52,50 @@ sql insert into t3 values('2017-12-25 21:27:41', 3)
print =============== step2 - login print =============== step2 - login
system_content curl 127.0.0.1:6020/grafana/ system_content curl 127.0.0.1:6041/grafana/
print 1-> $system_content print 1-> $system_content
if $system_content != @{"status":"error","code":5011,"desc":"no auth info input"}@ then if $system_content != @{"status":"error","code":5011,"desc":"no auth info input"}@ then
return -1 return -1
endi endi
system_content curl 127.0.0.1:6020/grafana/xx system_content curl 127.0.0.1:6041/grafana/xx
print 2-> $system_content print 2-> $system_content
if $system_content != @{"status":"error","code":5011,"desc":"no auth info input"}@ then if $system_content != @{"status":"error","code":5011,"desc":"no auth info input"}@ then
return -1 return -1
endi endi
system_content curl 127.0.0.1:6020/grafana/login/xx/xx/ system_content curl 127.0.0.1:6041/grafana/login/xx/xx/
print 3-> $system_content print 3-> $system_content
if $system_content != @{"status":"error","code":849,"desc":"Invalid user"}@ then if $system_content != @{"status":"error","code":849,"desc":"Invalid user"}@ then
return -1 return -1
endi endi
system_content curl 127.0.0.1:6020/grafana/root/1/123/1/1/3 system_content curl 127.0.0.1:6041/grafana/root/1/123/1/1/3
print 4-> $system_content print 4-> $system_content
if $system_content != @{"status":"error","code":5011,"desc":"no auth info input"}@ then if $system_content != @{"status":"error","code":5011,"desc":"no auth info input"}@ then
return -1 return -1
endi endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'show databases' 127.0.0.1:6020/grafana/login/1/root/1/ system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'show databases' 127.0.0.1:6041/grafana/login/1/root/1/
print 5-> $system_content print 5-> $system_content
if $system_content != @{"status":"error","code":849,"desc":"Invalid user"}@ then if $system_content != @{"status":"error","code":849,"desc":"Invalid user"}@ then
return -1 return -1
endi endi
system_content curl -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ3d3cudGFvc2RhdGEuY29tIiwicGFzcyI6InRhb3NkYXRhIiwic3ViIjoicm9vdCJ9.xPv3b5odlR7YF8G_QWASjIRbMtA5v4ItToJ35fFgi' -d 'show databases' 127.0.0.1:6020/grafana/root/1/login system_content curl -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ3d3cudGFvc2RhdGEuY29tIiwicGFzcyI6InRhb3NkYXRhIiwic3ViIjoicm9vdCJ9.xPv3b5odlR7YF8G_QWASjIRbMtA5v4ItToJ35fFgi' -d 'show databases' 127.0.0.1:6041/grafana/root/1/login
print 6-> $system_content print 6-> $system_content
if $system_content != @{"status":"error","code":5010,"desc":"invalid type of Authorization"}@ then if $system_content != @{"status":"error","code":5010,"desc":"invalid type of Authorization"}@ then
return -1 return -1
endi endi
system_content curl -H 'Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ3d3cudGFvc2RhdGEuY29tIiwicGFzcyI6InRhb3NkYXRhIiwic3ViIjoicm9vdCJ9.xPv3b5odlR7YF8G_QWASjIRbMtA5v4ItToJ35fFgi' -d 'show databases' 127.0.0.1:6020/grafana/root/1/login system_content curl -H 'Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ3d3cudGFvc2RhdGEuY29tIiwicGFzcyI6InRhb3NkYXRhIiwic3ViIjoicm9vdCJ9.xPv3b5odlR7YF8G_QWASjIRbMtA5v4ItToJ35fFgi' -d 'show databases' 127.0.0.1:6041/grafana/root/1/login
print 7-> $system_content print 7-> $system_content
if $system_content != @{"status":"error","code":5010,"desc":"invalid type of Authorization"}@ then if $system_content != @{"status":"error","code":5010,"desc":"invalid type of Authorization"}@ then
return -1 return -1
endi endi
sleep 3000 sleep 3000
system_content curl 127.0.0.1:6020/grafana/login/root/taosdata system_content curl 127.0.0.1:6041/grafana/login/root/taosdata
print 8-> $system_content print 8-> $system_content
if $system_content != @{"status":"succ","code":0,"desc":"/KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04"}@ then if $system_content != @{"status":"succ","code":0,"desc":"/KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04"}@ then
return -1 return -1
...@@ -103,7 +103,7 @@ endi ...@@ -103,7 +103,7 @@ endi
print =============== step3 - heartbeat print =============== step3 - heartbeat
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' 127.0.0.1:6020/grafana/d1/table_gc system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' 127.0.0.1:6041/grafana/d1/table_gc
print 9-> $system_content print 9-> $system_content
if $system_content != @{"message":"Grafana server receive a quest from you!"}@ then if $system_content != @{"message":"Grafana server receive a quest from you!"}@ then
return -1 return -1
...@@ -111,19 +111,19 @@ endi ...@@ -111,19 +111,19 @@ endi
print =============== step4 - search print =============== step4 - search
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' 127.0.0.1:6020/grafana/heartbeat system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' 127.0.0.1:6041/grafana/heartbeat
print 10-> $system_content print 10-> $system_content
if $system_content != @{"message":"Grafana server receive a quest from you!"}@ then if $system_content != @{"message":"Grafana server receive a quest from you!"}@ then
return -1 return -1
endi endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' 127.0.0.1:6020/grafana/d1/table_invalid/search system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' 127.0.0.1:6041/grafana/d1/table_invalid/search
print 11-> $system_content print 11-> $system_content
if $system_content != @{"message":"Grafana server receive a quest from you!"}@ then if $system_content != @{"message":"Grafana server receive a quest from you!"}@ then
return -1 return -1
endi endi
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' 127.0.0.1:6020/grafana/d1/m1/search system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' 127.0.0.1:6041/grafana/d1/m1/search
print 12-> $system_content print 12-> $system_content
if $system_content != @{"message":"Grafana server receive a quest from you!"}@ then if $system_content != @{"message":"Grafana server receive a quest from you!"}@ then
return -1 return -1
...@@ -131,49 +131,49 @@ endi ...@@ -131,49 +131,49 @@ endi
print =============== step5 - query print =============== step5 - query
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d '[{"refId":"A","alias":"taosd","sql":"select first(v1) from d1.m1 where ts > 1514208523020 and ts < 1514208523030 interval(1m)"},{"refId":"B","alias":"system","sql":"select first(v2) from d1.m1 where ts > 1514208523020 and ts < 1514208523030 interval(1m)"}]' 127.0.0.1:6020/grafana/query system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d '[{"refId":"A","alias":"taosd","sql":"select first(v1) from d1.m1 where ts > 1514208523020 and ts < 1514208523030 interval(1m)"},{"refId":"B","alias":"system","sql":"select first(v2) from d1.m1 where ts > 1514208523020 and ts < 1514208523030 interval(1m)"}]' 127.0.0.1:6041/grafana/query
print 13-> $system_content print 13-> $system_content
if $system_content != @[{"refId":"A","target":"taosd","datapoints":[[2,1514208480000]]},{"refId":"B","target":"system","datapoints":[[5.10000,1514208480000]]}]@ then if $system_content != @[{"refId":"A","target":"taosd","datapoints":[[2,1514208480000]]},{"refId":"B","target":"system","datapoints":[[5.10000,1514208480000]]}]@ then
return -1 return -1
endi endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d '[{"refId":"A","alias":"","sql":"select first(v1) from d1.m1 where ts > 1514208523020 and ts < 1514208523030 interval(1m)"},{"refId":"B","alias":"","sql":"select first(v2) from d1.m1 where ts > 1514208523020 and ts < 1514208523030 interval(1m)"}]' 127.0.0.1:6020/grafana/query system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d '[{"refId":"A","alias":"","sql":"select first(v1) from d1.m1 where ts > 1514208523020 and ts < 1514208523030 interval(1m)"},{"refId":"B","alias":"","sql":"select first(v2) from d1.m1 where ts > 1514208523020 and ts < 1514208523030 interval(1m)"}]' 127.0.0.1:6041/grafana/query
print 14-> $system_content print 14-> $system_content
if $system_content != @[{"refId":"A","target":"A","datapoints":[[2,1514208480000]]},{"refId":"B","target":"B","datapoints":[[5.10000,1514208480000]]}]@ then if $system_content != @[{"refId":"A","target":"A","datapoints":[[2,1514208480000]]},{"refId":"B","target":"B","datapoints":[[5.10000,1514208480000]]}]@ then
return -1 return -1
endi endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d '[{"refId":"A","alias":"","sql":"select count(v1) from d1.m1"},{"refId":"B","alias":"","sql":"select count(v2) from d1.m1"}]' 127.0.0.1:6020/grafana/query system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d '[{"refId":"A","alias":"","sql":"select count(v1) from d1.m1"},{"refId":"B","alias":"","sql":"select count(v2) from d1.m1"}]' 127.0.0.1:6041/grafana/query
print 15-> $system_content print 15-> $system_content
if $system_content != @[{"refId":"A","target":"A","datapoints":[[3,"-"]]},{"refId":"B","target":"B","datapoints":[[3,"-"]]}]@ then if $system_content != @[{"refId":"A","target":"A","datapoints":[[3,"-"]]},{"refId":"B","target":"B","datapoints":[[3,"-"]]}]@ then
return -1 return -1
endi endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d '[{"refId":"A","alias":"","sql":"select count(v1) from d1.m1"},{"refId":"B","alias":"","sql":"select count(v2) from d1.m1"}]' 127.0.0.1:6020/grafana/query system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d '[{"refId":"A","alias":"","sql":"select count(v1) from d1.m1"},{"refId":"B","alias":"","sql":"select count(v2) from d1.m1"}]' 127.0.0.1:6041/grafana/query
print 15-> $system_content print 15-> $system_content
if $system_content != @[{"refId":"A","target":"A","datapoints":[[3,"-"]]},{"refId":"B","target":"B","datapoints":[[3,"-"]]}]@ then if $system_content != @[{"refId":"A","target":"A","datapoints":[[3,"-"]]},{"refId":"B","target":"B","datapoints":[[3,"-"]]}]@ then
return -1 return -1
endi endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d '[{"refId":"A","alias":"","sql":"select count(i) from d1.mt group by a"},{"refId":"B","alias":"","sql":"select sum(i) from d1.mt group by b"}]' 127.0.0.1:6020/grafana/query system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d '[{"refId":"A","alias":"","sql":"select count(i) from d1.mt group by a"},{"refId":"B","alias":"","sql":"select sum(i) from d1.mt group by b"}]' 127.0.0.1:6041/grafana/query
print 16-> $system_content print 16-> $system_content
if $system_content != @[{"refId":"A","target":"{a:1,}","datapoints":[[5,"-"]]},{"refId":"A","target":"{a:2,}","datapoints":[[4,"-"]]},{"refId":"A","target":"{a:3,}","datapoints":[[3,"-"]]},{"refId":"B","target":"{b:a}","datapoints":[[5,"-"]]},{"refId":"B","target":"{b:b}","datapoints":[[8,"-"]]},{"refId":"B","target":"{b:c}","datapoints":[[9,"-"]]}]@ then if $system_content != @[{"refId":"A","target":"{a:1,}","datapoints":[[5,"-"]]},{"refId":"A","target":"{a:2,}","datapoints":[[4,"-"]]},{"refId":"A","target":"{a:3,}","datapoints":[[3,"-"]]},{"refId":"B","target":"{b:a}","datapoints":[[5,"-"]]},{"refId":"B","target":"{b:b}","datapoints":[[8,"-"]]},{"refId":"B","target":"{b:c}","datapoints":[[9,"-"]]}]@ then
return -1 return -1
endi endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d '[{"refId":"A","alias":"count","sql":"select count(i) from d1.mt group by a"},{"refId":"B","alias":"sum-","sql":"select sum(i) from d1.mt group by b"}]' 127.0.0.1:6020/grafana/query system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d '[{"refId":"A","alias":"count","sql":"select count(i) from d1.mt group by a"},{"refId":"B","alias":"sum-","sql":"select sum(i) from d1.mt group by b"}]' 127.0.0.1:6041/grafana/query
print 17-> $system_content print 17-> $system_content
if $system_content != @[{"refId":"A","target":"count{a:1,}","datapoints":[[5,"-"]]},{"refId":"A","target":"count{a:2,}","datapoints":[[4,"-"]]},{"refId":"A","target":"count{a:3,}","datapoints":[[3,"-"]]},{"refId":"B","target":"sum-{b:a}","datapoints":[[5,"-"]]},{"refId":"B","target":"sum-{b:b}","datapoints":[[8,"-"]]},{"refId":"B","target":"sum-{b:c}","datapoints":[[9,"-"]]}]@ then if $system_content != @[{"refId":"A","target":"count{a:1,}","datapoints":[[5,"-"]]},{"refId":"A","target":"count{a:2,}","datapoints":[[4,"-"]]},{"refId":"A","target":"count{a:3,}","datapoints":[[3,"-"]]},{"refId":"B","target":"sum-{b:a}","datapoints":[[5,"-"]]},{"refId":"B","target":"sum-{b:b}","datapoints":[[8,"-"]]},{"refId":"B","target":"sum-{b:c}","datapoints":[[9,"-"]]}]@ then
return -1 return -1
endi endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d '[{"refId":"A","alias":"count","sql":"select count(i) from d1.mt interval(1m) group by a "}]' 127.0.0.1:6020/grafana/query system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d '[{"refId":"A","alias":"count","sql":"select count(i) from d1.mt interval(1m) group by a "}]' 127.0.0.1:6041/grafana/query
print 18-> $system_content print 18-> $system_content
if $system_content != @[{"refId":"A","target":"count{a:1,}","datapoints":[[1,1514208300000],[1,1514208360000],[1,1514208420000],[1,1514208480000],[1,1514208540000]]},{"refId":"A","target":"count{a:2,}","datapoints":[[1,1514208300000],[1,1514208360000],[1,1514208420000],[1,1514208480000]]},{"refId":"A","target":"count{a:3,}","datapoints":[[1,1514208300000],[1,1514208360000],[1,1514208420000]]}]@ then if $system_content != @[{"refId":"A","target":"count{a:1,}","datapoints":[[1,1514208300000],[1,1514208360000],[1,1514208420000],[1,1514208480000],[1,1514208540000]]},{"refId":"A","target":"count{a:2,}","datapoints":[[1,1514208300000],[1,1514208360000],[1,1514208420000],[1,1514208480000]]},{"refId":"A","target":"count{a:3,}","datapoints":[[1,1514208300000],[1,1514208360000],[1,1514208420000]]}]@ then
return -1 return -1
endi endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d '[{"refId":"A","alias":"","sql":"select sum(v2), count(v1) from d1.m1"},{"refId":"B","alias":"","sql":"select count(v2), sum(v2) from d1.m1"}]' 127.0.0.1:6020/grafana/query system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d '[{"refId":"A","alias":"","sql":"select sum(v2), count(v1) from d1.m1"},{"refId":"B","alias":"","sql":"select count(v2), sum(v2) from d1.m1"}]' 127.0.0.1:6041/grafana/query
print 19-> $system_content print 19-> $system_content
if $system_content != @[{"refId":"A","target":"{count(v1):3}","datapoints":[[15.299999714,"-"]]},{"refId":"B","target":"{sum(v2):15.299999714}","datapoints":[[3,"-"]]}]@ then if $system_content != @[{"refId":"A","target":"{count(v1):3}","datapoints":[[15.299999714,"-"]]},{"refId":"B","target":"{sum(v2):15.299999714}","datapoints":[[3,"-"]]}]@ then
return -1 return -1
......
...@@ -34,8 +34,8 @@ sleep 4000 ...@@ -34,8 +34,8 @@ sleep 4000
print =============== step2 - login print =============== step2 - login
system_content curl 127.0.0.1:6020/rest/login/root/taosdata system_content curl 127.0.0.1:6041/rest/login/root/taosdata
print curl 127.0.0.1:6020/rest/login/root/taosdata -----> $system_content print curl 127.0.0.1:6041/rest/login/root/taosdata -----> $system_content
if $system_content != @{"status":"succ","code":0,"desc":"/KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04"}@ then if $system_content != @{"status":"succ","code":0,"desc":"/KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04"}@ then
return -1 return -1
...@@ -45,8 +45,8 @@ return ...@@ -45,8 +45,8 @@ return
print =============== step3 - query data print =============== step3 - query data
system_content curl -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ3d3cudGFvc2RhdGEuY29tIiwia2V5IjoiYkVsOExjdkxVZDdhOHFkdE5abXRPTnJ5cDIwMW1hMDQiLCJzdWIiOiJyb290In0.k7CkgmpOJImIkLqZqzASlPmkdeEw7Wfk4XUrqGZX-LQ' -d 'select * from t1' 127.0.0.1:6020/rest/sql/d1 system_content curl -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ3d3cudGFvc2RhdGEuY29tIiwia2V5IjoiYkVsOExjdkxVZDdhOHFkdE5abXRPTnJ5cDIwMW1hMDQiLCJzdWIiOiJyb290In0.k7CkgmpOJImIkLqZqzASlPmkdeEw7Wfk4XUrqGZX-LQ' -d 'select * from t1' 127.0.0.1:6041/rest/sql/d1
print curl 127.0.0.1:6020/rest/sql/d1 -----> $system_content print curl 127.0.0.1:6041/rest/sql/d1 -----> $system_content
if $system_content != @{"status":"succ","head":["ts","i","b"],"data":[["2017-12-25 21:28:54.022",14,"44\\\\\"\"44"],["2017-12-25 21:28:53.022",13,"33\\\\\"33"],["2017-12-25 21:28:52.022",12,"22\\\\11"],["2017-12-25 21:28:51.022",11,"11\\\\11"],["2017-12-25 21:28:49.022",9,"99\\99"],["2017-12-25 21:28:48.022",8,"88\"\"88"],["2017-12-25 21:28:47.022",7,"77\"7\""],["2017-12-25 21:28:46.022",6,"66'6'"],["2017-12-25 21:28:45.022",5,"55'"],["2017-12-25 21:28:44.022",4,"44\""],["2017-12-25 21:28:43.022",3,"33"],["2017-12-25 21:28:42.022",2,"22"],["2017-12-25 21:28:41.022",1,"11"]],"rows":13}@ then if $system_content != @{"status":"succ","head":["ts","i","b"],"data":[["2017-12-25 21:28:54.022",14,"44\\\\\"\"44"],["2017-12-25 21:28:53.022",13,"33\\\\\"33"],["2017-12-25 21:28:52.022",12,"22\\\\11"],["2017-12-25 21:28:51.022",11,"11\\\\11"],["2017-12-25 21:28:49.022",9,"99\\99"],["2017-12-25 21:28:48.022",8,"88\"\"88"],["2017-12-25 21:28:47.022",7,"77\"7\""],["2017-12-25 21:28:46.022",6,"66'6'"],["2017-12-25 21:28:45.022",5,"55'"],["2017-12-25 21:28:44.022",4,"44\""],["2017-12-25 21:28:43.022",3,"33"],["2017-12-25 21:28:42.022",2,"22"],["2017-12-25 21:28:41.022",1,"11"]],"rows":13}@ then
return -1 return -1
endi endi
......
...@@ -30,8 +30,8 @@ sql insert into table_rest values('2017-12-25 21:28:50.022', 10) ...@@ -30,8 +30,8 @@ sql insert into table_rest values('2017-12-25 21:28:50.022', 10)
print =============== step2 - login print =============== step2 - login
system_content curl 127.0.0.1:6020/rest/login/root/taosdata system_content curl 127.0.0.1:6041/rest/login/root/taosdata
print curl 127.0.0.1:6020/rest/login/root/taosdata -----> $system_content print curl 127.0.0.1:6041/rest/login/root/taosdata -----> $system_content
if $system_content != {"status":"succ","code":0,"desc":"/KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04"} then if $system_content != {"status":"succ","code":0,"desc":"/KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04"} then
return -1 return -1
...@@ -39,44 +39,44 @@ endi ...@@ -39,44 +39,44 @@ endi
print =============== step3 - query data print =============== step3 - query data
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'select * from d1.table_rest' 127.0.0.1:6020/rest/sql system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'select * from d1.table_rest' 127.0.0.1:6041/rest/sql
print curl 127.0.0.1:6020/rest/sql -----> $system_content print curl 127.0.0.1:6041/rest/sql -----> $system_content
if $system_content != @{"status":"succ","head":["ts","i"],"data":[["2017-12-25 21:28:41.022",1],["2017-12-25 21:28:42.022",2],["2017-12-25 21:28:43.022",3],["2017-12-25 21:28:44.022",4],["2017-12-25 21:28:45.022",5],["2017-12-25 21:28:46.022",6],["2017-12-25 21:28:47.022",7],["2017-12-25 21:28:48.022",8],["2017-12-25 21:28:49.022",9],["2017-12-25 21:28:50.022",10]],"rows":10}@ then if $system_content != @{"status":"succ","head":["ts","i"],"data":[["2017-12-25 21:28:41.022",1],["2017-12-25 21:28:42.022",2],["2017-12-25 21:28:43.022",3],["2017-12-25 21:28:44.022",4],["2017-12-25 21:28:45.022",5],["2017-12-25 21:28:46.022",6],["2017-12-25 21:28:47.022",7],["2017-12-25 21:28:48.022",8],["2017-12-25 21:28:49.022",9],["2017-12-25 21:28:50.022",10]],"rows":10}@ then
return -1 return -1
endi endi
print =============== step4 - insert data print =============== step4 - insert data
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d "insert into d1.table_rest values('2017-12-25 21:28:51.022', 11)" 127.0.0.1:6020/rest/sql system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d "insert into d1.table_rest values('2017-12-25 21:28:51.022', 11)" 127.0.0.1:6041/rest/sql
print curl 127.0.0.1:6020/rest/sql -----> $system_content print curl 127.0.0.1:6041/rest/sql -----> $system_content
if $system_content != @{"status":"succ","head":["affected_rows"],"data":[[1]],"rows":1}@ then if $system_content != @{"status":"succ","head":["affected_rows"],"data":[[1]],"rows":1}@ then
return -1 return -1
endi endi
print =============== step5 - query data print =============== step5 - query data
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'select * from d1.table_rest' 127.0.0.1:6020/rest/sql system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'select * from d1.table_rest' 127.0.0.1:6041/rest/sql
print curl 127.0.0.1:6020/rest/sql -----> $system_content print curl 127.0.0.1:6041/rest/sql -----> $system_content
if $system_content != @{"status":"succ","head":["ts","i"],"data":[["2017-12-25 21:28:41.022",1],["2017-12-25 21:28:42.022",2],["2017-12-25 21:28:43.022",3],["2017-12-25 21:28:44.022",4],["2017-12-25 21:28:45.022",5],["2017-12-25 21:28:46.022",6],["2017-12-25 21:28:47.022",7],["2017-12-25 21:28:48.022",8],["2017-12-25 21:28:49.022",9],["2017-12-25 21:28:50.022",10],["2017-12-25 21:28:51.022",11]],"rows":11}@ then if $system_content != @{"status":"succ","head":["ts","i"],"data":[["2017-12-25 21:28:41.022",1],["2017-12-25 21:28:42.022",2],["2017-12-25 21:28:43.022",3],["2017-12-25 21:28:44.022",4],["2017-12-25 21:28:45.022",5],["2017-12-25 21:28:46.022",6],["2017-12-25 21:28:47.022",7],["2017-12-25 21:28:48.022",8],["2017-12-25 21:28:49.022",9],["2017-12-25 21:28:50.022",10],["2017-12-25 21:28:51.022",11]],"rows":11}@ then
return -1 return -1
endi endi
print =============== step6 - query no db data print =============== step6 - query no db data
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'show dnodes' 127.0.0.1:6020/rest/sql system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'show dnodes' 127.0.0.1:6041/rest/sql
print curl 127.0.0.1:6020/rest/sql -----> $system_content print curl 127.0.0.1:6041/rest/sql -----> $system_content
print =============== step7 - change password print =============== step7 - change password
sql create user u1 PASS 'abcd@1234' sql create user u1 PASS 'abcd@1234'
sql create user u2 PASS 'abcd_1234' sql create user u2 PASS 'abcd_1234'
system_content curl 127.0.0.1:6020/rest/login/u1/abcd@1234 system_content curl 127.0.0.1:6041/rest/login/u1/abcd@1234
print curl 127.0.0.1:6020/rest/login/u1/abcd@1234 -----> $system_content print curl 127.0.0.1:6041/rest/login/u1/abcd@1234 -----> $system_content
if $system_content != @{"status":"succ","code":0,"desc":"jIlItaLFFIPa8qdtNZmtONryp201ma04SXX8PEJowKAB/46k1gwnPNryp201ma04"}@ then if $system_content != @{"status":"succ","code":0,"desc":"jIlItaLFFIPa8qdtNZmtONryp201ma04SXX8PEJowKAB/46k1gwnPNryp201ma04"}@ then
return -1 return -1
endi endi
system_content curl 127.0.0.1:6020/rest/login/u2/aabcd_1234 system_content curl 127.0.0.1:6041/rest/login/u2/aabcd_1234
print curl 127.0.0.1:6020/rest/login/u2/abcd_1234 -----> $system_content print curl 127.0.0.1:6041/rest/login/u2/abcd_1234 -----> $system_content
if $system_content != @{"status":"error","code":3,"desc":"Authentication failure"}@ then if $system_content != @{"status":"error","code":3,"desc":"Authentication failure"}@ then
return -1 return -1
endi endi
......
...@@ -12,57 +12,57 @@ print ============================ dnode1 start ...@@ -12,57 +12,57 @@ print ============================ dnode1 start
print =============== step1 - login print =============== step1 - login
system_content curl 127.0.0.1:6020/rest/ system_content curl 127.0.0.1:6041/rest/
print 1-> $system_content print 1-> $system_content
if $system_content != @{"status":"error","code":5011,"desc":"no auth info input"}@ then if $system_content != @{"status":"error","code":5011,"desc":"no auth info input"}@ then
return -1 return -1
endi endi
system_content curl 127.0.0.1:6020/rest/xx system_content curl 127.0.0.1:6041/rest/xx
print 2-> $system_content print 2-> $system_content
if $system_content != @{"status":"error","code":5011,"desc":"no auth info input"}@ then if $system_content != @{"status":"error","code":5011,"desc":"no auth info input"}@ then
return -1 return -1
endi endi
system_content curl 127.0.0.1:6020/rest/login system_content curl 127.0.0.1:6041/rest/login
print 3-> $system_content print 3-> $system_content
if $system_content != @{"status":"error","code":5011,"desc":"no auth info input"}@ then if $system_content != @{"status":"error","code":5011,"desc":"no auth info input"}@ then
return -1 return -1
endi endi
#4 #4
system_content curl 127.0.0.1:6020/rest/login/root system_content curl 127.0.0.1:6041/rest/login/root
print 4-> $system_content print 4-> $system_content
if $system_content != @{"status":"error","code":5011,"desc":"no auth info input"}@ then if $system_content != @{"status":"error","code":5011,"desc":"no auth info input"}@ then
return -1 return -1
endi endi
system_content curl 127.0.0.1:6020/rest/login/root/123 system_content curl 127.0.0.1:6041/rest/login/root/123
print 5-> $system_content print 5-> $system_content
if $system_content != @{"status":"error","code":3,"desc":"Authentication failure"}@ then if $system_content != @{"status":"error","code":3,"desc":"Authentication failure"}@ then
return -1 return -1
endi endi
system_content curl 127.0.0.1:6020/rest/login/root/123/1/1/3 system_content curl 127.0.0.1:6041/rest/login/root/123/1/1/3
print 6-> $system_content print 6-> $system_content
if $system_content != @{"status":"error","code":3,"desc":"Authentication failure"}@ then if $system_content != @{"status":"error","code":3,"desc":"Authentication failure"}@ then
return -1 return -1
endi endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'show databases' 127.0.0.1:6020/rest/login/root/1 system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'show databases' 127.0.0.1:6041/rest/login/root/1
print 7-> $system_content print 7-> $system_content
if $system_content != @{"status":"error","code":3,"desc":"Authentication failure"}@ then if $system_content != @{"status":"error","code":3,"desc":"Authentication failure"}@ then
return -1 return -1
endi endi
#8 #8
system_content curl -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ3d3cudGFvc2RhdGEuY29tIiwicGFzcyI6InRhb3NkYXRhIiwic3ViIjoicm9vdCJ9.xPv3b5odlR7YF8G_QWASjIRbMtA5v4ItToJ35fFgi' -d 'show databases' 127.0.0.1:6020/rest/login/root/1 system_content curl -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ3d3cudGFvc2RhdGEuY29tIiwicGFzcyI6InRhb3NkYXRhIiwic3ViIjoicm9vdCJ9.xPv3b5odlR7YF8G_QWASjIRbMtA5v4ItToJ35fFgi' -d 'show databases' 127.0.0.1:6041/rest/login/root/1
print 8-> $system_content print 8-> $system_content
if $system_content != @{"status":"error","code":5010,"desc":"invalid type of Authorization"}@ then if $system_content != @{"status":"error","code":5010,"desc":"invalid type of Authorization"}@ then
return -1 return -1
endi endi
system_content curl -H 'Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ3d3cudGFvc2RhdGEuY29tIiwicGFzcyI6InRhb3NkYXRhIiwic3ViIjoicm9vdCJ9.xPv3b5odlR7YF8G_QWASjIRbMtA5v4ItToJ35fFgi' -d 'show databases' 127.0.0.1:6020/rest/login/root/1 system_content curl -H 'Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ3d3cudGFvc2RhdGEuY29tIiwicGFzcyI6InRhb3NkYXRhIiwic3ViIjoicm9vdCJ9.xPv3b5odlR7YF8G_QWASjIRbMtA5v4ItToJ35fFgi' -d 'show databases' 127.0.0.1:6041/rest/login/root/1
print 9-> $system_content print 9-> $system_content
if $system_content != @{"status":"error","code":5010,"desc":"invalid type of Authorization"}@ then if $system_content != @{"status":"error","code":5010,"desc":"invalid type of Authorization"}@ then
return -1 return -1
...@@ -70,7 +70,7 @@ endi ...@@ -70,7 +70,7 @@ endi
sleep 3000 sleep 3000
system_content curl 127.0.0.1:6020/rest/login/root/taosdata/ system_content curl 127.0.0.1:6041/rest/login/root/taosdata/
print 10-> $system_content print 10-> $system_content
if $system_content != @{"status":"succ","code":0,"desc":"/KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04"}@ then if $system_content != @{"status":"succ","code":0,"desc":"/KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04"}@ then
return -1 return -1
...@@ -79,52 +79,52 @@ endi ...@@ -79,52 +79,52 @@ endi
print =============== step2 - no db print =============== step2 - no db
#11 #11
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'show databases' 127.0.0.1:6020/rest/sql system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'show databases' 127.0.0.1:6041/rest/sql
print 11-> $system_content print 11-> $system_content
if $system_content != @{"status":"succ","head":["name","created_time","ntables","vgroups","replica","quorum","days","keep1,keep2,keep(D)","cache(MB)","blocks","minrows","maxrows","wallevel","fsync","comp","precision","status"],"data":[],"rows":0}@ then if $system_content != @{"status":"succ","head":["name","created_time","ntables","vgroups","replica","quorum","days","keep1,keep2,keep(D)","cache(MB)","blocks","minrows","maxrows","wallevel","fsync","comp","precision","status"],"data":[],"rows":0}@ then
return -1 return -1
endi endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'create database d1' 127.0.0.1:6020/rest/sql system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'create database d1' 127.0.0.1:6041/rest/sql
print 12-> $system_content print 12-> $system_content
if $system_content != @{"status":"succ","head":["affected_rows"],"data":[[0]],"rows":0}@ then if $system_content != @{"status":"succ","head":["affected_rows"],"data":[[0]],"rows":0}@ then
return -1 return -1
endi endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'create database d1' 127.0.0.1:6020/rest/sql system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'create database d1' 127.0.0.1:6041/rest/sql
print 13-> $system_content print 13-> $system_content
if $system_content != @{"status":"error","code":897,"desc":"Database already exists"}@ then if $system_content != @{"status":"error","code":897,"desc":"Database already exists"}@ then
return -1 return -1
endi endi
#14 #14
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d '' 127.0.0.1:6020/rest/sql system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d '' 127.0.0.1:6041/rest/sql
print 14-> $system_content print 14-> $system_content
if $system_content != @{"status":"error","code":5012,"desc":"no sql input"}@ then if $system_content != @{"status":"error","code":5012,"desc":"no sql input"}@ then
return -1 return -1
endi endi
#system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'use d1' 127.0.0.1:6020/rest/sql #system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'use d1' 127.0.0.1:6041/rest/sql
#print 15-> $system_content #print 15-> $system_content
#if $system_content != @{"status":"error","code":5017,"desc":"no need to execute use db cmd"}@ then #if $system_content != @{"status":"error","code":5017,"desc":"no need to execute use db cmd"}@ then
#if $system_content != @{"status":"succ","head":["affected_rows"],"data":[[1]],"rows":1}@ then #if $system_content != @{"status":"succ","head":["affected_rows"],"data":[[1]],"rows":1}@ then
# return -1 # return -1
#endi #endi
#system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d ' use d1' 127.0.0.1:6020/rest/sql #system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d ' use d1' 127.0.0.1:6041/rest/sql
#print 16-> $system_content #print 16-> $system_content
#if $system_content != @{"status":"error","code":5017,"desc":"no need to execute use db cmd"}@ then #if $system_content != @{"status":"error","code":5017,"desc":"no need to execute use db cmd"}@ then
# return -1 # return -1
#endi #endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d ' used1' 127.0.0.1:6020/rest/sql system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d ' used1' 127.0.0.1:6041/rest/sql
print 17-> $system_content print 17-> $system_content
if $system_content != @{"status":"error","code":512,"desc":"invalid SQL: invalid SQL: syntax error near 'used1'"}@ then if $system_content != @{"status":"error","code":512,"desc":"invalid SQL: invalid SQL: syntax error near 'used1'"}@ then
return -1 return -1
endi endi
#18 #18
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d ' show tables;' 127.0.0.1:6020/rest/sql system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d ' show tables;' 127.0.0.1:6041/rest/sql
print 18-> $system_content print 18-> $system_content
if $system_content != @{"status":"error","code":896,"desc":"Database not specified or available"}@ then if $system_content != @{"status":"error","code":896,"desc":"Database not specified or available"}@ then
return -1 return -1
...@@ -133,44 +133,44 @@ endi ...@@ -133,44 +133,44 @@ endi
print =============== step3 - db print =============== step3 - db
#19 #19
#system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d ' show tables;' 127.0.0.1:6020/rest/sql/d4 #system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d ' show tables;' 127.0.0.1:6041/rest/sql/d4
#print 19-> $system_content #print 19-> $system_content
#if $system_content != @{"status":"error","code":1000,"desc":"invalid DB"}@ then #if $system_content != @{"status":"error","code":1000,"desc":"invalid DB"}@ then
# return -1 # return -1
#endi #endi
#system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d ' show tables;' 127.0.0.1:6020/rest/sql/d1 #system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d ' show tables;' 127.0.0.1:6041/rest/sql/d1
#print 20-> $system_content #print 20-> $system_content
#if $system_content != @{"status":"succ","head":["name","created time","columns","metric"],"data":[],"rows":0}@ then #if $system_content != @{"status":"succ","head":["name","created time","columns","metric"],"data":[],"rows":0}@ then
# return -1 # return -1
#endi #endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d ' select * from d1.t1;' 127.0.0.1:6020/rest/sql system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d ' select * from d1.t1;' 127.0.0.1:6041/rest/sql
print 21-> $system_content print 21-> $system_content
if $system_content != @{"status":"error","code":866,"desc":"Table does not exist"}@ then if $system_content != @{"status":"error","code":866,"desc":"Table does not exist"}@ then
return -1 return -1
endi endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d ' create table d1.t1 (ts timestamp, speed int)' 127.0.0.1:6020/rest/sql system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d ' create table d1.t1 (ts timestamp, speed int)' 127.0.0.1:6041/rest/sql
print 22-> $system_content print 22-> $system_content
if $system_content != @{"status":"succ","head":["affected_rows"],"data":[[0]],"rows":0}@ then if $system_content != @{"status":"succ","head":["affected_rows"],"data":[[0]],"rows":0}@ then
return -1 return -1
endi endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d ' select * from d1.t1 ' 127.0.0.1:6020/rest/sql system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d ' select * from d1.t1 ' 127.0.0.1:6041/rest/sql
print 23-> $system_content print 23-> $system_content
if $system_content != @{"status":"succ","head":["ts","speed"],"data":[],"rows":0}@ then if $system_content != @{"status":"succ","head":["ts","speed"],"data":[],"rows":0}@ then
return -1 return -1
endi endi
#24 #24
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d "insert into d1.t1 values('2017-12-25 21:28:41.022', 1)" 127.0.0.1:6020/rest/sql system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d "insert into d1.t1 values('2017-12-25 21:28:41.022', 1)" 127.0.0.1:6041/rest/sql
print 24-> $system_content print 24-> $system_content
if $system_content != @{"status":"succ","head":["affected_rows"],"data":[[1]],"rows":1}@ then if $system_content != @{"status":"succ","head":["affected_rows"],"data":[[1]],"rows":1}@ then
return -1 return -1
endi endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d ' select * from d1.t1 ' 127.0.0.1:6020/rest/sql system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d ' select * from d1.t1 ' 127.0.0.1:6041/rest/sql
print 25-> $system_content print 25-> $system_content
if $system_content != @{"status":"succ","head":["ts","speed"],"data":[["2017-12-25 21:28:41.022",1]],"rows":1}@ then if $system_content != @{"status":"succ","head":["ts","speed"],"data":[["2017-12-25 21:28:41.022",1]],"rows":1}@ then
return -1 return -1
...@@ -178,53 +178,53 @@ endi ...@@ -178,53 +178,53 @@ endi
#26 #26
print 25-> no print print 25-> no print
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d "insert into d1.t1 values('2017-12-25 21:28:42.022', 2)" 127.0.0.1:6020/rest/sql system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d "insert into d1.t1 values('2017-12-25 21:28:42.022', 2)" 127.0.0.1:6041/rest/sql
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d "insert into d1.t1 values('2017-12-25 21:28:43.022', 3)" 127.0.0.1:6020/rest/sql system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d "insert into d1.t1 values('2017-12-25 21:28:43.022', 3)" 127.0.0.1:6041/rest/sql
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d "insert into d1.t1 values('2017-12-25 21:28:44.022', 4)" 127.0.0.1:6020/rest/sql system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d "insert into d1.t1 values('2017-12-25 21:28:44.022', 4)" 127.0.0.1:6041/rest/sql
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d "insert into d1.t1 values('2017-12-25 21:28:45.022', 5)" 127.0.0.1:6020/rest/sql system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d "insert into d1.t1 values('2017-12-25 21:28:45.022', 5)" 127.0.0.1:6041/rest/sql
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d "insert into d1.t1 values('2017-12-25 21:28:46.022', 6)" 127.0.0.1:6020/rest/sql system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d "insert into d1.t1 values('2017-12-25 21:28:46.022', 6)" 127.0.0.1:6041/rest/sql
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d "insert into d1.t1 values('2017-12-25 21:28:47.022', 7)" 127.0.0.1:6020/rest/sql system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d "insert into d1.t1 values('2017-12-25 21:28:47.022', 7)" 127.0.0.1:6041/rest/sql
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d "insert into d1.t1 values('2017-12-25 21:28:48.022', 8)" 127.0.0.1:6020/rest/sql system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d "insert into d1.t1 values('2017-12-25 21:28:48.022', 8)" 127.0.0.1:6041/rest/sql
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d "insert into d1.t1 values('2017-12-25 21:28:49.022', 9)" 127.0.0.1:6020/rest/sql system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d "insert into d1.t1 values('2017-12-25 21:28:49.022', 9)" 127.0.0.1:6041/rest/sql
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d "insert into d1.t1 values('2017-12-25 21:28:50.022', 10)" 127.0.0.1:6020/rest/sql system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d "insert into d1.t1 values('2017-12-25 21:28:50.022', 10)" 127.0.0.1:6041/rest/sql
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d "insert into d1.t1 values('2017-12-25 21:28:51.022', 11)" 127.0.0.1:6020/rest/sql system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d "insert into d1.t1 values('2017-12-25 21:28:51.022', 11)" 127.0.0.1:6041/rest/sql
#27 #27
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d ' select * from d1.t1 ' 127.0.0.1:6020/rest/sql system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d ' select * from d1.t1 ' 127.0.0.1:6041/rest/sql
print 27-> $system_content print 27-> $system_content
if $system_content != @{"status":"succ","head":["ts","speed"],"data":[["2017-12-25 21:28:41.022",1],["2017-12-25 21:28:42.022",2],["2017-12-25 21:28:43.022",3],["2017-12-25 21:28:44.022",4],["2017-12-25 21:28:45.022",5],["2017-12-25 21:28:46.022",6],["2017-12-25 21:28:47.022",7],["2017-12-25 21:28:48.022",8],["2017-12-25 21:28:49.022",9],["2017-12-25 21:28:50.022",10],["2017-12-25 21:28:51.022",11]],"rows":11}@ then if $system_content != @{"status":"succ","head":["ts","speed"],"data":[["2017-12-25 21:28:41.022",1],["2017-12-25 21:28:42.022",2],["2017-12-25 21:28:43.022",3],["2017-12-25 21:28:44.022",4],["2017-12-25 21:28:45.022",5],["2017-12-25 21:28:46.022",6],["2017-12-25 21:28:47.022",7],["2017-12-25 21:28:48.022",8],["2017-12-25 21:28:49.022",9],["2017-12-25 21:28:50.022",10],["2017-12-25 21:28:51.022",11]],"rows":11}@ then
return -1 return -1
endi endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'create database d2' 127.0.0.1:6020/rest/sql system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'create database d2' 127.0.0.1:6041/rest/sql
print 28-> $system_content print 28-> $system_content
if $system_content != @{"status":"succ","head":["affected_rows"],"data":[[0]],"rows":0}@ then if $system_content != @{"status":"succ","head":["affected_rows"],"data":[[0]],"rows":0}@ then
return -1 return -1
endi endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d ' create table d2.t1 (ts timestamp, speed int)' 127.0.0.1:6020/rest/sql system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d ' create table d2.t1 (ts timestamp, speed int)' 127.0.0.1:6041/rest/sql
print 29-> $system_content print 29-> $system_content
if $system_content != @{"status":"succ","head":["affected_rows"],"data":[[0]],"rows":0}@ then if $system_content != @{"status":"succ","head":["affected_rows"],"data":[[0]],"rows":0}@ then
return -1 return -1
endi endi
#30 #30
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d "insert into d2.t1 values('2017-12-25 21:28:41.022', 1)" 127.0.0.1:6020/rest/sql system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d "insert into d2.t1 values('2017-12-25 21:28:41.022', 1)" 127.0.0.1:6041/rest/sql
print 30-> $system_content print 30-> $system_content
if $system_content != @{"status":"succ","head":["affected_rows"],"data":[[1]],"rows":1}@ then if $system_content != @{"status":"succ","head":["affected_rows"],"data":[[1]],"rows":1}@ then
return -1 return -1
endi endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d ' select * from d2.t1 ' 127.0.0.1:6020/rest/sql system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d ' select * from d2.t1 ' 127.0.0.1:6041/rest/sql
print 31-> $system_content print 31-> $system_content
if $system_content != @{"status":"succ","head":["ts","speed"],"data":[["2017-12-25 21:28:41.022",1]],"rows":1}@ then if $system_content != @{"status":"succ","head":["ts","speed"],"data":[["2017-12-25 21:28:41.022",1]],"rows":1}@ then
return -1 return -1
......
...@@ -28,8 +28,8 @@ sql create table d1.table_rest9 (ts timestamp, i int) ...@@ -28,8 +28,8 @@ sql create table d1.table_rest9 (ts timestamp, i int)
print =============== step2 - login print =============== step2 - login
system_content curl 127.0.0.1:6020/rest/login/root/taosdata system_content curl 127.0.0.1:6041/rest/login/root/taosdata
print curl 127.0.0.1:6020/rest/login/root/taosdata -----> $system_content print curl 127.0.0.1:6041/rest/login/root/taosdata -----> $system_content
if $system_content != {"status":"succ","code":0,"desc":"/KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04"} then if $system_content != {"status":"succ","code":0,"desc":"/KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04"} then
return -1 return -1
...@@ -37,17 +37,17 @@ endi ...@@ -37,17 +37,17 @@ endi
print =============== step3 - query data print =============== step3 - query data
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'insert into d1.table_rest1 values('now+1s', 1) d1.table_rest2 values('now+1s', 1) d1.table_rest3 values('now+1s', 1) d1.table_rest4 values('now+1s', 1) ' 127.0.0.1:6020/rest/sql system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'insert into d1.table_rest1 values('now+1s', 1) d1.table_rest2 values('now+1s', 1) d1.table_rest3 values('now+1s', 1) d1.table_rest4 values('now+1s', 1) ' 127.0.0.1:6041/rest/sql
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'insert into d1.table_rest1 values('now+1s', 1) d1.table_rest2 values('now+1s', 1) d1.table_rest3 values('now+1s', 1) d1.table_rest4 values('now+1s', 1) ' 127.0.0.1:6020/rest/sql system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'insert into d1.table_rest1 values('now+1s', 1) d1.table_rest2 values('now+1s', 1) d1.table_rest3 values('now+1s', 1) d1.table_rest4 values('now+1s', 1) ' 127.0.0.1:6041/rest/sql
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'insert into d1.table_rest1 values('now+1s', 1) d1.table_rest2 values('now+1s', 1) d1.table_rest3 values('now+1s', 1) d1.table_rest4 values('now+1s', 1) ' 127.0.0.1:6020/rest/sql system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'insert into d1.table_rest1 values('now+1s', 1) d1.table_rest2 values('now+1s', 1) d1.table_rest3 values('now+1s', 1) d1.table_rest4 values('now+1s', 1) ' 127.0.0.1:6041/rest/sql
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'insert into d1.table_rest1 values('now+1s', 1) d1.table_rest2 values('now+1s', 1) d1.table_rest3 values('now+1s', 1) d1.table_rest4 values('now+1s', 1) ' 127.0.0.1:6020/rest/sql system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'insert into d1.table_rest1 values('now+1s', 1) d1.table_rest2 values('now+1s', 1) d1.table_rest3 values('now+1s', 1) d1.table_rest4 values('now+1s', 1) ' 127.0.0.1:6041/rest/sql
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'insert into d1.table_rest1 values('now+1s', 1) d1.table_rest2 values('now+1s', 1) d1.table_rest3 values('now+1s', 1) d1.table_rest4 values('now+1s', 1) ' 127.0.0.1:6020/rest/sql system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'insert into d1.table_rest1 values('now+1s', 1) d1.table_rest2 values('now+1s', 1) d1.table_rest3 values('now+1s', 1) d1.table_rest4 values('now+1s', 1) ' 127.0.0.1:6041/rest/sql
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'insert into d1.table_rest1 values('now+1s', 1) d1.table_rest2 values('now+1s', 1) d1.table_rest3 values('now+1s', 1) d1.table_rest4 values('now+1s', 1) ' 127.0.0.1:6020/rest/sql system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'insert into d1.table_rest1 values('now+1s', 1) d1.table_rest2 values('now+1s', 1) d1.table_rest3 values('now+1s', 1) d1.table_rest4 values('now+1s', 1) ' 127.0.0.1:6041/rest/sql
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'insert into d1.table_rest1 values('now+1s', 1) d1.table_rest2 values('now+1s', 1) d1.table_rest3 values('now+1s', 1) d1.table_rest4 values('now+1s', 1) ' 127.0.0.1:6020/rest/sql system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'insert into d1.table_rest1 values('now+1s', 1) d1.table_rest2 values('now+1s', 1) d1.table_rest3 values('now+1s', 1) d1.table_rest4 values('now+1s', 1) ' 127.0.0.1:6041/rest/sql
print =============== step5 - query data print =============== step5 - query data
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'select * from d1.table_rest1' 127.0.0.1:6020/rest/sql system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'select * from d1.table_rest1' 127.0.0.1:6041/rest/sql
print curl 127.0.0.1:6020/rest/sql -----> $system_content print curl 127.0.0.1:6041/rest/sql -----> $system_content
system sh/exec.sh -n dnode1 -s stop -x SIGINT system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -37,10 +37,10 @@ while $i < 2 ...@@ -37,10 +37,10 @@ while $i < 2
$i = $i + 1 $i = $i + 1
endw endw
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d 'select * from db0.st0 limit 100' 127.0.0.1:6020/rest/sql system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d 'select * from db0.st0 limit 100' 127.0.0.1:6041/rest/sql
print curl 127.0.0.1:6020/rest/sql -----> $system_content print curl 127.0.0.1:6041/rest/sql -----> $system_content
#system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d "select * from db0.st0 where tbname in ('tb0', 'tb1') limit 1000" 127.0.0.1:6020/rest/sql #system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d "select * from db0.st0 where tbname in ('tb0', 'tb1') limit 1000" 127.0.0.1:6041/rest/sql
#print curl 127.0.0.1:6020/rest/sql -----> $system_content #print curl 127.0.0.1:6041/rest/sql -----> $system_content
system sh/exec.sh -n dnode1 -s stop -x SIGINT system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
...@@ -38,6 +38,6 @@ sql insert into t2 values(1575880055000, 2); ...@@ -38,6 +38,6 @@ sql insert into t2 values(1575880055000, 2);
sql select st1.ts, st1.f1, st2.f2 from db.st1, db.st2 where st1.t1=st2.t2 and st1.ts=st2.ts sql select st1.ts, st1.f1, st2.f2 from db.st1, db.st2 where st1.t1=st2.t2 and st1.ts=st2.ts
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'select st1.ts, st1.f1, st2.f2 from db.st1, db.st2 where st1.t1=st2.t2 and st1.ts=st2.ts' 127.0.0.1:6020/restful/sql system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'select st1.ts, st1.f1, st2.f2 from db.st1, db.st2 where st1.t1=st2.t2 and st1.ts=st2.ts' 127.0.0.1:6041/restful/sql
system sh/exec.sh -n dnode1 -s stop -x SIGINT system sh/exec.sh -n dnode1 -s stop -x SIGINT
...@@ -31,63 +31,63 @@ sql insert into table_admin values('2017-12-25 21:28:50.022', 10) ...@@ -31,63 +31,63 @@ sql insert into table_admin values('2017-12-25 21:28:50.022', 10)
print =============== step1 - login print =============== step1 - login
system_content curl 127.0.0.1:6020/admin/ system_content curl 127.0.0.1:6041/admin/
print 1-> $system_content print 1-> $system_content
if $system_content != @{"status":"error","code":5011,"desc":"no auth info input"}@ then if $system_content != @{"status":"error","code":5011,"desc":"no auth info input"}@ then
return -1 return -1
endi endi
system_content curl 127.0.0.1:6020/admin/xx system_content curl 127.0.0.1:6041/admin/xx
print 2-> $system_content print 2-> $system_content
if $system_content != @{"status":"error","code":5011,"desc":"no auth info input"}@ then if $system_content != @{"status":"error","code":5011,"desc":"no auth info input"}@ then
return -1 return -1
endi endi
system_content curl 127.0.0.1:6020/admin/login system_content curl 127.0.0.1:6041/admin/login
print 3-> $system_content print 3-> $system_content
if $system_content != @{"status":"error","code":5011,"desc":"no auth info input"}@ then if $system_content != @{"status":"error","code":5011,"desc":"no auth info input"}@ then
return -1 return -1
endi endi
system_content curl 127.0.0.1:6020/admin/login/root system_content curl 127.0.0.1:6041/admin/login/root
print 4-> $system_content print 4-> $system_content
if $system_content != @{"status":"error","code":5011,"desc":"no auth info input"}@ then if $system_content != @{"status":"error","code":5011,"desc":"no auth info input"}@ then
return -1 return -1
endi endi
system_content curl 127.0.0.1:6020/admin/login/root/123 system_content curl 127.0.0.1:6041/admin/login/root/123
print 5-> $system_content print 5-> $system_content
if $system_content != @{"status":"error","code":3,"desc":"Authentication failure"}@ then if $system_content != @{"status":"error","code":3,"desc":"Authentication failure"}@ then
return -1 return -1
endi endi
system_content curl 127.0.0.1:6020/admin/login/root/123/1/1/3 system_content curl 127.0.0.1:6041/admin/login/root/123/1/1/3
print 6-> $system_content print 6-> $system_content
if $system_content != @{"status":"error","code":3,"desc":"Authentication failure"}@ then if $system_content != @{"status":"error","code":3,"desc":"Authentication failure"}@ then
return -1 return -1
endi endi
system_content curl -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.' -d 'show databases' 127.0.0.1:6020/admin/login/root/1 system_content curl -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.' -d 'show databases' 127.0.0.1:6041/admin/login/root/1
print 7-> $system_content print 7-> $system_content
if $system_content != @{"status":"error","code":5010,"desc":"invalid type of Authorization"}@ then if $system_content != @{"status":"error","code":5010,"desc":"invalid type of Authorization"}@ then
return -1 return -1
endi endi
system_content curl -H 'Authorization: Taosd eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ3d3cudGFvc2RhdGEuY29tIiwicGFzcyI6InRhb3NkYXRhIiwic3ViIjoicm9vdCJ9.xPv3b5odlR7YF8G_QWASjIRbMtA5v4ItToJ35fFgi' 127.0.0.1:6020/admin/login/root/1 system_content curl -H 'Authorization: Taosd eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ3d3cudGFvc2RhdGEuY29tIiwicGFzcyI6InRhb3NkYXRhIiwic3ViIjoicm9vdCJ9.xPv3b5odlR7YF8G_QWASjIRbMtA5v4ItToJ35fFgi' 127.0.0.1:6041/admin/login/root/1
print 8-> $system_content print 8-> $system_content
if $system_content != @{"status":"error","code":5053,"desc":"parse http auth token error"}@ then if $system_content != @{"status":"error","code":5053,"desc":"parse http auth token error"}@ then
return -1 return -1
endi endi
sleep 3000 sleep 3000
system_content curl 127.0.0.1:6020/admin/login/root/taosdata system_content curl 127.0.0.1:6041/admin/login/root/taosdata
print 9 -----> $system_content print 9 -----> $system_content
if $system_content != {"status":"succ","code":0,"desc":"/KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04"} then if $system_content != {"status":"succ","code":0,"desc":"/KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04"} then
return -1 return -1
endi endi
#system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'show databases' 127.0.0.1:6020/admin/login/root/1 #system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'show databases' 127.0.0.1:6041/admin/login/root/1
#print 10-> $system_content #print 10-> $system_content
#if $system_content != @{"status":"error","code":29,"desc":"failed to connect to server"}@ then #if $system_content != @{"status":"error","code":29,"desc":"failed to connect to server"}@ then
# return -1 # return -1
...@@ -95,14 +95,14 @@ endi ...@@ -95,14 +95,14 @@ endi
print =============== step2 - logout print =============== step2 - logout
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' 127.0.0.1:6020/admin/logout system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' 127.0.0.1:6041/admin/logout
print 10 -----> $system_content print 10 -----> $system_content
if $system_content != @{"status":"succ","code":0,"desc":"logout success"}@ then if $system_content != @{"status":"succ","code":0,"desc":"logout success"}@ then
return -1 return -1
endi endi
system_content curl 127.0.0.1:6020/admin/logout system_content curl 127.0.0.1:6041/admin/logout
print 11 -----> $system_content print 11 -----> $system_content
if $system_content != @{"status":"error","code":5011,"desc":"no auth info input"}@ then if $system_content != @{"status":"error","code":5011,"desc":"no auth info input"}@ then
...@@ -111,69 +111,69 @@ endi ...@@ -111,69 +111,69 @@ endi
print =============== step3 - info print =============== step3 - info
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' 127.0.0.1:6020/admin/info system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' 127.0.0.1:6041/admin/info
print curl 127.0.0.1:6020/admin/info -----> $system_content print curl 127.0.0.1:6041/admin/info -----> $system_content
if $system_content != {"status":"succ","data":[{"dbs":1,"tables":1,"users":3,"mnodes":1,"dnodes":1}]} then if $system_content != {"status":"succ","data":[{"dbs":1,"tables":1,"users":3,"mnodes":1,"dnodes":1}]} then
return -1 return -1
endi endi
print =============== step4 - meta print =============== step4 - meta
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'show mnodes' 127.0.0.1:6020/admin/meta system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'show mnodes' 127.0.0.1:6041/admin/meta
print curl 127.0.0.1:6020/admin/meta -----> $system_content print curl 127.0.0.1:6041/admin/meta -----> $system_content
#if $system_content != @{"status":"succ","head":["column type","column name","column bytes"],"data":[["binary","IP",16],["timestamp","created time",8],["binary","status",10],["binary","role",10],["binary","public ip",16]],"rows":5}@ then #if $system_content != @{"status":"succ","head":["column type","column name","column bytes"],"data":[["binary","IP",16],["timestamp","created time",8],["binary","status",10],["binary","role",10],["binary","public ip",16]],"rows":5}@ then
# return -1 # return -1
#endi #endi
print =============== step5 - query data print =============== step5 - query data
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'select * from d1.table_admin' 127.0.0.1:6020/admin/sql system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'select * from d1.table_admin' 127.0.0.1:6041/admin/sql
print curl 127.0.0.1:6020/admin/all -----> $system_content print curl 127.0.0.1:6041/admin/all -----> $system_content
if $system_content != @{"status":"succ","head":["ts","i"],"data":[["2017-12-25 21:28:41.022",1],["2017-12-25 21:28:42.022",2],["2017-12-25 21:28:43.022",3],["2017-12-25 21:28:44.022",4],["2017-12-25 21:28:45.022",5],["2017-12-25 21:28:46.022",6],["2017-12-25 21:28:47.022",7],["2017-12-25 21:28:48.022",8],["2017-12-25 21:28:49.022",9],["2017-12-25 21:28:50.022",10]],"rows":10}@ then if $system_content != @{"status":"succ","head":["ts","i"],"data":[["2017-12-25 21:28:41.022",1],["2017-12-25 21:28:42.022",2],["2017-12-25 21:28:43.022",3],["2017-12-25 21:28:44.022",4],["2017-12-25 21:28:45.022",5],["2017-12-25 21:28:46.022",6],["2017-12-25 21:28:47.022",7],["2017-12-25 21:28:48.022",8],["2017-12-25 21:28:49.022",9],["2017-12-25 21:28:50.022",10]],"rows":10}@ then
return -1 return -1
endi endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'select * from d1.table_admin' 127.0.0.1:6020/admin/sql system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'select * from d1.table_admin' 127.0.0.1:6041/admin/sql
print curl 127.0.0.1:6020/admin/sql -----> $system_content print curl 127.0.0.1:6041/admin/sql -----> $system_content
if $system_content != @{"status":"succ","head":["ts","i"],"data":[["2017-12-25 21:28:41.022",1],["2017-12-25 21:28:42.022",2],["2017-12-25 21:28:43.022",3],["2017-12-25 21:28:44.022",4],["2017-12-25 21:28:45.022",5],["2017-12-25 21:28:46.022",6],["2017-12-25 21:28:47.022",7],["2017-12-25 21:28:48.022",8],["2017-12-25 21:28:49.022",9],["2017-12-25 21:28:50.022",10]],"rows":10}@ then if $system_content != @{"status":"succ","head":["ts","i"],"data":[["2017-12-25 21:28:41.022",1],["2017-12-25 21:28:42.022",2],["2017-12-25 21:28:43.022",3],["2017-12-25 21:28:44.022",4],["2017-12-25 21:28:45.022",5],["2017-12-25 21:28:46.022",6],["2017-12-25 21:28:47.022",7],["2017-12-25 21:28:48.022",8],["2017-12-25 21:28:49.022",9],["2017-12-25 21:28:50.022",10]],"rows":10}@ then
return -1 return -1
endi endi
print =============== step6 - insert data print =============== step6 - insert data
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d "insert into d1.table_admin values('2017-12-25 21:28:51.022', 11)" 127.0.0.1:6020/admin/sql system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d "insert into d1.table_admin values('2017-12-25 21:28:51.022', 11)" 127.0.0.1:6041/admin/sql
print curl 127.0.0.1:6020/admin/sql -----> $system_content print curl 127.0.0.1:6041/admin/sql -----> $system_content
if $system_content != @{"status":"succ","head":["affect_rows"],"data":[[1]],"rows":1}@ then if $system_content != @{"status":"succ","head":["affect_rows"],"data":[[1]],"rows":1}@ then
return -1 return -1
endi endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'select * from d1.table_admin' 127.0.0.1:6020/admin/all system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'select * from d1.table_admin' 127.0.0.1:6041/admin/all
print curl 127.0.0.1:6020/admin/all -----> $system_content print curl 127.0.0.1:6041/admin/all -----> $system_content
if $system_content != @{"status":"succ","head":["ts","i"],"data":[["2017-12-25 21:28:41.022",1],["2017-12-25 21:28:42.022",2],["2017-12-25 21:28:43.022",3],["2017-12-25 21:28:44.022",4],["2017-12-25 21:28:45.022",5],["2017-12-25 21:28:46.022",6],["2017-12-25 21:28:47.022",7],["2017-12-25 21:28:48.022",8],["2017-12-25 21:28:49.022",9],["2017-12-25 21:28:50.022",10],["2017-12-25 21:28:51.022",11]],"rows":11}@ then if $system_content != @{"status":"succ","head":["ts","i"],"data":[["2017-12-25 21:28:41.022",1],["2017-12-25 21:28:42.022",2],["2017-12-25 21:28:43.022",3],["2017-12-25 21:28:44.022",4],["2017-12-25 21:28:45.022",5],["2017-12-25 21:28:46.022",6],["2017-12-25 21:28:47.022",7],["2017-12-25 21:28:48.022",8],["2017-12-25 21:28:49.022",9],["2017-12-25 21:28:50.022",10],["2017-12-25 21:28:51.022",11]],"rows":11}@ then
return -1 return -1
endi endi
#system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'select * from d1.table_admin' 127.0.0.1:6020/admin/sql #system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'select * from d1.table_admin' 127.0.0.1:6041/admin/sql
#print curl 127.0.0.1:6020/admin/sql -----> $system_content #print curl 127.0.0.1:6041/admin/sql -----> $system_content
#if $system_content != @{"status":"succ","head":["ts","i"],"data":[["2017-12-25 21:28:51.022",11],["2017-12-25 21:28:50.022",10],["2017-12-25 21:28:49.022",9],["2017-12-25 21:28:48.022",8],["2017-12-25 21:28:47.022",7],["2017-12-25 21:28:46.022",6],["2017-12-25 21:28:45.022",5],["2017-12-25 21:28:44.022",4],["2017-12-25 21:28:43.022",3],["2017-12-25 21:28:42.022",2]],"rows":10}@ then #if $system_content != @{"status":"succ","head":["ts","i"],"data":[["2017-12-25 21:28:51.022",11],["2017-12-25 21:28:50.022",10],["2017-12-25 21:28:49.022",9],["2017-12-25 21:28:48.022",8],["2017-12-25 21:28:47.022",7],["2017-12-25 21:28:46.022",6],["2017-12-25 21:28:45.022",5],["2017-12-25 21:28:44.022",4],["2017-12-25 21:28:43.022",3],["2017-12-25 21:28:42.022",2]],"rows":10}@ then
# return -1 # return -1
#endi #endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' 127.0.0.1:6020/admin/info system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' 127.0.0.1:6041/admin/info
print curl 127.0.0.1:6020/admin/info -----> $system_content print curl 127.0.0.1:6041/admin/info -----> $system_content
if $system_content != {"status":"succ","data":[{"dbs":1,"tables":1,"users":3,"mnodes":1,"dnodes":1}]} then if $system_content != {"status":"succ","data":[{"dbs":1,"tables":1,"users":3,"mnodes":1,"dnodes":1}]} then
return -1 return -1
endi endi
print =============== step7 - use dbs print =============== step7 - use dbs
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'use d1;' 127.0.0.1:6020/admin/all system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'use d1;' 127.0.0.1:6041/admin/all
print 23-> $system_content print 23-> $system_content
if $system_content != @{"status":"error","code":5017,"desc":"no need to execute use db cmd"}@ then if $system_content != @{"status":"error","code":5017,"desc":"no need to execute use db cmd"}@ then
return -1 return -1
endi endi
print =============== step8 - monitor dbs print =============== step8 - monitor dbs
#system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'show dnodes;show mnodes;' 127.0.0.1:6020/admin/sqls #system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'show dnodes;show mnodes;' 127.0.0.1:6041/admin/sqls
#print 24-> $system_content #print 24-> $system_content
#if $system_content != @[{"status":"succ","head":["IP","created time","open vnodes","free vnodes","status","balance state"],"data":[["127.0.0.1","2018-09-04 #11:16:13.985",1,3,"ready","balanced"]],"rows":1},{"status":"succ","head":["IP","created time","status","role"],"data":[["127.0.0.1","2018-09-04 11:16:13.371","serving","master"]],"rows":1}]@ then #if $system_content != @[{"status":"succ","head":["IP","created time","open vnodes","free vnodes","status","balance state"],"data":[["127.0.0.1","2018-09-04 #11:16:13.985",1,3,"ready","balanced"]],"rows":1},{"status":"succ","head":["IP","created time","status","role"],"data":[["127.0.0.1","2018-09-04 11:16:13.371","serving","master"]],"rows":1}]@ then
# return -1 # return -1
......
...@@ -11,92 +11,92 @@ sql connect ...@@ -11,92 +11,92 @@ sql connect
print ============================ dnode1 start print ============================ dnode1 start
print =============== step1 - parse print =============== step1 - parse
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/ system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:6041/opentsdb/
print $system_content print $system_content
if $system_content != @{"status":"error","code":5057,"desc":"database name can not be null"}@ then if $system_content != @{"status":"error","code":5057,"desc":"database name can not be null"}@ then
return -1 return -1
endi endi
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/db123456789012345678901234567890db system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:6041/opentsdb/db123456789012345678901234567890db
print $system_content print $system_content
if $system_content != @{"status":"error","code":5058,"desc":"database name too long"}@ then if $system_content != @{"status":"error","code":5058,"desc":"database name too long"}@ then
return -1 return -1
endi endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/ system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:6041/opentsdb/
print $system_content print $system_content
if $system_content != @{"status":"error","code":5057,"desc":"database name can not be null"}@ then if $system_content != @{"status":"error","code":5057,"desc":"database name can not be null"}@ then
return -1 return -1
endi endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/db/put2 system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:6041/opentsdb/db/put2
print $system_content print $system_content
if $system_content != @{"status":"error","code":5009,"desc":"http url parse error"}@ then if $system_content != @{"status":"error","code":5009,"desc":"http url parse error"}@ then
return -1 return -1
endi endi
system_content curl -u root:taosdata -d '[]' 127.0.0.1:6020/opentsdb/db/put system_content curl -u root:taosdata -d '[]' 127.0.0.1:6041/opentsdb/db/put
print $system_content print $system_content
if $system_content != @{"status":"error","code":5060,"desc":"metrics size is 0"}@ then if $system_content != @{"status":"error","code":5060,"desc":"metrics size is 0"}@ then
return -1 return -1
endi endi
system_content curl -u root:taosdata -d '[' 127.0.0.1:6020/opentsdb/db/put system_content curl -u root:taosdata -d '[' 127.0.0.1:6041/opentsdb/db/put
print $system_content print $system_content
if $system_content != @{"status":"error","code":5059,"desc":"invalid opentsdb json fromat"}@ then if $system_content != @{"status":"error","code":5059,"desc":"invalid opentsdb json fromat"}@ then
return -1 return -1
endi endi
system_content curl -u root:taosdata -d '{}' 127.0.0.1:6020/opentsdb/db/put system_content curl -u root:taosdata -d '{}' 127.0.0.1:6041/opentsdb/db/put
print $system_content print $system_content
if $system_content != @{"status":"error","code":5060,"desc":"metrics size is 0"}@ then if $system_content != @{"status":"error","code":5060,"desc":"metrics size is 0"}@ then
return -1 return -1
endi endi
system_content curl -u root:taosdata -d '[{}]' 127.0.0.1:6020/opentsdb/db/put system_content curl -u root:taosdata -d '[{}]' 127.0.0.1:6041/opentsdb/db/put
print $system_content print $system_content
if $system_content != @{"status":"error","code":5062,"desc":"metric name not find"}@ then if $system_content != @{"status":"error","code":5062,"desc":"metric name not find"}@ then
return -1 return -1
endi endi
system_content curl -u root:taosdata -d '[{"metric": 1,"timestamp": 1346846400,"value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/db/put system_content curl -u root:taosdata -d '[{"metric": 1,"timestamp": 1346846400,"value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:6041/opentsdb/db/put
print $system_content print $system_content
if $system_content != @{"status":"error","code":5063,"desc":"metric name type should be string"}@ then if $system_content != @{"status":"error","code":5063,"desc":"metric name type should be string"}@ then
return -1 return -1
endi endi
system_content curl -u root:taosdata -d '[{"metric": "","timestamp": 1346846400,"value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/db/put system_content curl -u root:taosdata -d '[{"metric": "","timestamp": 1346846400,"value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:6041/opentsdb/db/put
print $system_content print $system_content
if $system_content != @{"status":"error","code":5064,"desc":"metric name length is 0"}@ then if $system_content != @{"status":"error","code":5064,"desc":"metric name length is 0"}@ then
return -1 return -1
endi endi
system_content curl -u root:taosdata -d '[{"metric": "ab1234567890123456789012345678ab1234567890123456789012345678","timestamp": 1346846400,"value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/db/put system_content curl -u root:taosdata -d '[{"metric": "ab1234567890123456789012345678ab1234567890123456789012345678","timestamp": 1346846400,"value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:6041/opentsdb/db/put
print $system_content print $system_content
if $system_content != @{"errors":[{"datapoint":{"metric":"ab1234567890123456789012345678ab1234567890123456789012345678","stable":"ab1234567890123456789012345678ab1234567890123456789012345678_d_bbb","table":"ab1234567890123456789012345678ab1234567890123456789012345678_d_bbb_lga_1_web01","timestamp":1346846400,"value":18.000000,"tags":{"dc":"lga","group1":"1","host":"web01"},"status":"error","code":1547,"desc":"Timestamp data out of range"}}],"failed":1,"success":0,"affected_rows":0}@ then if $system_content != @{"errors":[{"datapoint":{"metric":"ab1234567890123456789012345678ab1234567890123456789012345678","stable":"ab1234567890123456789012345678ab1234567890123456789012345678_d_bbb","table":"ab1234567890123456789012345678ab1234567890123456789012345678_d_bbb_lga_1_web01","timestamp":1346846400,"value":18.000000,"tags":{"dc":"lga","group1":"1","host":"web01"},"status":"error","code":1547,"desc":"Timestamp data out of range"}}],"failed":1,"success":0,"affected_rows":0}@ then
return -1 return -1
endi endi
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/db/put system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:6041/opentsdb/db/put
print $system_content print $system_content
if $system_content != @{"status":"error","code":5066,"desc":"timestamp not find"}@ then if $system_content != @{"status":"error","code":5066,"desc":"timestamp not find"}@ then
return -1 return -1
endi endi
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": "2","value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/db/put system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": "2","value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:6041/opentsdb/db/put
print $system_content print $system_content
if $system_content != @{"status":"error","code":5067,"desc":"timestamp type should be integer"}@ then if $system_content != @{"status":"error","code":5067,"desc":"timestamp type should be integer"}@ then
return -1 return -1
endi endi
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": -1,"value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/db/put system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": -1,"value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:6041/opentsdb/db/put
print $system_content print $system_content
if $system_content != @{"status":"error","code":5068,"desc":"timestamp value smaller than 0"}@ then if $system_content != @{"status":"error","code":5068,"desc":"timestamp value smaller than 0"}@ then
return -1 return -1
endi endi
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/db/put system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:6041/opentsdb/db/put
print $system_content print $system_content
if $system_content != @{"status":"error","code":5078,"desc":"value not find"}@ then if $system_content != @{"status":"error","code":5078,"desc":"value not find"}@ then
return -1 return -1
...@@ -104,49 +104,49 @@ endi ...@@ -104,49 +104,49 @@ endi
####### #######
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18}]' 127.0.0.1:6020/opentsdb/db/put system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18}]' 127.0.0.1:6041/opentsdb/db/put
print $system_content print $system_content
if $system_content != @{"status":"error","code":5069,"desc":"tags not find"}@ then if $system_content != @{"status":"error","code":5069,"desc":"tags not find"}@ then
return -1 return -1
endi endi
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {}}]' 127.0.0.1:6020/opentsdb/db/put system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {}}]' 127.0.0.1:6041/opentsdb/db/put
print $system_content print $system_content
if $system_content != @{"status":"error","code":5070,"desc":"tags size is 0"}@ then if $system_content != @{"status":"error","code":5070,"desc":"tags size is 0"}@ then
return -1 return -1
endi endi
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": 0}]' 127.0.0.1:6020/opentsdb/db/put system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": 0}]' 127.0.0.1:6041/opentsdb/db/put
print $system_content print $system_content
if $system_content != @{"status":"error","code":5070,"desc":"tags size is 0"}@ then if $system_content != @{"status":"error","code":5070,"desc":"tags size is 0"}@ then
return -1 return -1
endi endi
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {"host": "web01","group1": "1","group1": "1","group1": "1","group1": "1","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/db/put system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {"host": "web01","group1": "1","group1": "1","group1": "1","group1": "1","group1": "1","dc": "lga"}}]' 127.0.0.1:6041/opentsdb/db/put
print $system_content print $system_content
if $system_content != @{"errors":[{"datapoint":{"metric":"sys_cpu","stable":"sys_cpu_d_bbbbbbb","table":"sys_cpu_d_bbbbbbb_lga_1_1_1_1_1_web01","timestamp":1346846400,"value":18.000000,"tags":{"dc":"lga","group1":"1","group1":"1","group1":"1","group1":"1","group1":"1","host":"web01"},"status":"error","code":866,"desc":"failed to create table"}}],"failed":1,"success":0,"affected_rows":0}@ then if $system_content != @{"errors":[{"datapoint":{"metric":"sys_cpu","stable":"sys_cpu_d_bbbbbbb","table":"sys_cpu_d_bbbbbbb_lga_1_1_1_1_1_web01","timestamp":1346846400,"value":18.000000,"tags":{"dc":"lga","group1":"1","group1":"1","group1":"1","group1":"1","group1":"1","host":"web01"},"status":"error","code":866,"desc":"failed to create table"}}],"failed":1,"success":0,"affected_rows":0}@ then
return -1 return -1
endi endi
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {"": "web01"}}]' 127.0.0.1:6020/opentsdb/db/put system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {"": "web01"}}]' 127.0.0.1:6041/opentsdb/db/put
print $system_content print $system_content
if $system_content != @{"status":"error","code":5073,"desc":"tag name is null"}@ then if $system_content != @{"status":"error","code":5073,"desc":"tag name is null"}@ then
return -1 return -1
endi endi
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {"host01123456789001123456789001123456789001123456789001123456789001123456789": "01"}}]' 127.0.0.1:6020/opentsdb/db/put system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {"host01123456789001123456789001123456789001123456789001123456789001123456789": "01"}}]' 127.0.0.1:6041/opentsdb/db/put
print $system_content print $system_content
if $system_content != @{"status":"error","code":5074,"desc":"tag name length too long"}@ then if $system_content != @{"status":"error","code":5074,"desc":"tag name length too long"}@ then
return -1 return -1
endi endi
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {"host": "web011234567890011234567890011234567890011234567890011234567890011234567890011234567890011234567890"}}]' 127.0.0.1:6020/opentsdb/db/put system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {"host": "web011234567890011234567890011234567890011234567890011234567890011234567890011234567890011234567890"}}]' 127.0.0.1:6041/opentsdb/db/put
print $system_content print $system_content
if $system_content != @{"status":"error","code":5077,"desc":"tag value can not more than 64"}@ then if $system_content != @{"status":"error","code":5077,"desc":"tag value can not more than 64"}@ then
return -1 return -1
endi endi
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {"host": ""}}]' 127.0.0.1:6020/opentsdb/db/put system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {"host": ""}}]' 127.0.0.1:6041/opentsdb/db/put
print $system_content print $system_content
if $system_content != @{"status":"error","code":5076,"desc":"tag value is null"}@ then if $system_content != @{"status":"error","code":5076,"desc":"tag value is null"}@ then
return -1 return -1
...@@ -155,26 +155,26 @@ endi ...@@ -155,26 +155,26 @@ endi
sleep 3000 sleep 3000
print =============== step2 - insert single data print =============== step2 - insert single data
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400000,"value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/db/put system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400000,"value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:6041/opentsdb/db/put
print $system_content print $system_content
if $system_content != @{"errors":[{"datapoint":{"metric":"sys_cpu","stable":"sys_cpu_d_bbb","table":"sys_cpu_d_bbb_lga_1_web01","timestamp":1346846400000,"value":18.000000,"tags":{"dc":"lga","group1":"1","host":"web01"},"affected_rows":1,"status":"succ"}}],"failed":0,"success":1,"affected_rows":1}@ then if $system_content != @{"errors":[{"datapoint":{"metric":"sys_cpu","stable":"sys_cpu_d_bbb","table":"sys_cpu_d_bbb_lga_1_web01","timestamp":1346846400000,"value":18.000000,"tags":{"dc":"lga","group1":"1","host":"web01"},"affected_rows":1,"status":"succ"}}],"failed":0,"success":1,"affected_rows":1}@ then
return -1 return -1
endi endi
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400000,"value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/db/put system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400000,"value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:6041/opentsdb/db/put
print $system_content print $system_content
if $system_content != @{"errors":[{"datapoint":{"metric":"sys_cpu","stable":"sys_cpu_d_bbb","table":"sys_cpu_d_bbb_lga_1_web01","timestamp":1346846400000,"value":18.000000,"tags":{"dc":"lga","group1":"1","host":"web01"},"affected_rows":1,"status":"succ"}}],"failed":0,"success":1,"affected_rows":1}@ then if $system_content != @{"errors":[{"datapoint":{"metric":"sys_cpu","stable":"sys_cpu_d_bbb","table":"sys_cpu_d_bbb_lga_1_web01","timestamp":1346846400000,"value":18.000000,"tags":{"dc":"lga","group1":"1","host":"web01"},"affected_rows":1,"status":"succ"}}],"failed":0,"success":1,"affected_rows":1}@ then
return -1 return -1
endi endi
system_content curl -u root:taosdata -d 'select * from db.sys_cpu_d_bbb_lga_1_web01' 127.0.0.1:6020/rest/sql/ system_content curl -u root:taosdata -d 'select * from db.sys_cpu_d_bbb_lga_1_web01' 127.0.0.1:6041/rest/sql/
print $system_content print $system_content
if $system_content != @{"status":"succ","head":["ts","value"],"data":[["2012-09-05 20:00:00.000",18.000000000]],"rows":1}@ then if $system_content != @{"status":"succ","head":["ts","value"],"data":[["2012-09-05 20:00:00.000",18.000000000]],"rows":1}@ then
return -1 return -1
endi endi
print =============== step3 - multi-query data print =============== step3 - multi-query data
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846405000,"value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}},{"metric": "sys_cpu","timestamp": 1346846402000,"value": 18,"tags": {"host": "web02","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/db/put system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846405000,"value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}},{"metric": "sys_cpu","timestamp": 1346846402000,"value": 18,"tags": {"host": "web02","group1": "1","dc": "lga"}}]' 127.0.0.1:6041/opentsdb/db/put
print $system_content print $system_content
...@@ -182,7 +182,7 @@ if $system_content != @{"errors":[{"datapoint":{"metric":"sys_cpu","stable":"sys ...@@ -182,7 +182,7 @@ if $system_content != @{"errors":[{"datapoint":{"metric":"sys_cpu","stable":"sys
return -1 return -1
endi endi
system_content curl -u root:taosdata -d 'select * from db.sys_cpu_d_bbb_lga_1_web01' 127.0.0.1:6020/rest/sql/ system_content curl -u root:taosdata -d 'select * from db.sys_cpu_d_bbb_lga_1_web01' 127.0.0.1:6041/rest/sql/
print $system_content print $system_content
...@@ -190,7 +190,7 @@ if $system_content != @{"status":"succ","head":["ts","value"],"data":[["2012-09- ...@@ -190,7 +190,7 @@ if $system_content != @{"status":"succ","head":["ts","value"],"data":[["2012-09-
return -1 return -1
endi endi
system_content curl -u root:taosdata -d 'select count(*) from db.sys_cpu_d_bbb' 127.0.0.1:6020/rest/sql/ system_content curl -u root:taosdata -d 'select count(*) from db.sys_cpu_d_bbb' 127.0.0.1:6041/rest/sql/
print $system_content print $system_content
...@@ -199,7 +199,7 @@ if $system_content != @{"status":"succ","head":["count(*)"],"data":[[3]],"rows": ...@@ -199,7 +199,7 @@ if $system_content != @{"status":"succ","head":["count(*)"],"data":[[3]],"rows":
endi endi
print =============== step4 - summary-put data print =============== step4 - summary-put data
system_content curl -u root:taosdata -d '[{"metric": "sys_mem","timestamp": 1346846400000,"value": 8,"tags": {"host": "web01","group1": "1","dc": "lga"}},{"metric": "sys_mem","timestamp": 1346846405000,"value": 9,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/db/put?details=false system_content curl -u root:taosdata -d '[{"metric": "sys_mem","timestamp": 1346846400000,"value": 8,"tags": {"host": "web01","group1": "1","dc": "lga"}},{"metric": "sys_mem","timestamp": 1346846405000,"value": 9,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:6041/opentsdb/db/put?details=false
print $system_content print $system_content
...@@ -207,7 +207,7 @@ if $system_content != @{"failed":0,"success":2}@ then ...@@ -207,7 +207,7 @@ if $system_content != @{"failed":0,"success":2}@ then
return -1 return -1
endi endi
system_content curl -u root:taosdata -d 'select * from db.sys_mem_d_bbb_lga_1_web01' 127.0.0.1:6020/rest/sql/ system_content curl -u root:taosdata -d 'select * from db.sys_mem_d_bbb_lga_1_web01' 127.0.0.1:6041/rest/sql/
print $system_content print $system_content
...@@ -215,7 +215,7 @@ if $system_content != @{"status":"succ","head":["ts","value"],"data":[["2012-09- ...@@ -215,7 +215,7 @@ if $system_content != @{"status":"succ","head":["ts","value"],"data":[["2012-09-
return -1 return -1
endi endi
system_content curl -u root:taosdata -d 'select count(*) from db.sys_mem_d_bbb' 127.0.0.1:6020/rest/sql/ system_content curl -u root:taosdata -d 'select count(*) from db.sys_mem_d_bbb' 127.0.0.1:6041/rest/sql/
print $system_content print $system_content
...@@ -225,13 +225,13 @@ endi ...@@ -225,13 +225,13 @@ endi
print =============== step5 - prepare data print =============== step5 - prepare data
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846402000,"value": 19,"tags": {"host": "web01","group1": "1","dc": "lga"}},{"metric": "sys_cpu","timestamp": 1346846402,"value": 19,"tags": {"host": "web02","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/db/put system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846402000,"value": 19,"tags": {"host": "web01","group1": "1","dc": "lga"}},{"metric": "sys_cpu","timestamp": 1346846402,"value": 19,"tags": {"host": "web02","group1": "1","dc": "lga"}}]' 127.0.0.1:6041/opentsdb/db/put
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846403000,"value": 20,"tags": {"host": "web01","group1": "1","dc": "lga"}},{"metric": "sys_cpu","timestamp": 1346846403,"value": 20,"tags": {"host": "web02","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/db/put system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846403000,"value": 20,"tags": {"host": "web01","group1": "1","dc": "lga"}},{"metric": "sys_cpu","timestamp": 1346846403,"value": 20,"tags": {"host": "web02","group1": "1","dc": "lga"}}]' 127.0.0.1:6041/opentsdb/db/put
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846404000,"value": 21,"tags": {"host": "web01","group1": "1","dc": "lga"}},{"metric": "sys_cpu","timestamp": 1346846404,"value": 21,"tags": {"host": "web02","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/db/put system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846404000,"value": 21,"tags": {"host": "web01","group1": "1","dc": "lga"}},{"metric": "sys_cpu","timestamp": 1346846404,"value": 21,"tags": {"host": "web02","group1": "1","dc": "lga"}}]' 127.0.0.1:6041/opentsdb/db/put
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846405000,"value": 22,"tags": {"host": "web01","group1": "1","dc": "lga"}},{"metric": "sys_cpu","timestamp": 1346846405,"value": 22,"tags": {"host": "web02","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/db/put system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846405000,"value": 22,"tags": {"host": "web01","group1": "1","dc": "lga"}},{"metric": "sys_cpu","timestamp": 1346846405,"value": 22,"tags": {"host": "web02","group1": "1","dc": "lga"}}]' 127.0.0.1:6041/opentsdb/db/put
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846406000,"value": 23,"tags": {"host": "web01","group1": "1","dc": "lga"}},{"metric": "sys_cpu","timestamp": 1346846406,"value": 23,"tags": {"host": "web02","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/db/put system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846406000,"value": 23,"tags": {"host": "web01","group1": "1","dc": "lga"}},{"metric": "sys_cpu","timestamp": 1346846406,"value": 23,"tags": {"host": "web02","group1": "1","dc": "lga"}}]' 127.0.0.1:6041/opentsdb/db/put
system_content curl -u root:taosdata -d 'select count(*) from db.sys_cpu_d_bbb' 127.0.0.1:6020/rest/sql/ system_content curl -u root:taosdata -d 'select count(*) from db.sys_cpu_d_bbb' 127.0.0.1:6041/rest/sql/
print $system_content print $system_content
if $system_content != @{"status":"succ","head":["count(*)"],"data":[[7]],"rows":1}@ then if $system_content != @{"status":"succ","head":["count(*)"],"data":[[7]],"rows":1}@ then
return -1 return -1
......
...@@ -590,7 +590,7 @@ int simExecuteRestFulCommand(SScript *script, char *command) { ...@@ -590,7 +590,7 @@ int simExecuteRestFulCommand(SScript *script, char *command) {
bool simCreateRestFulConnect(SScript *script, char *user, char *pass) { bool simCreateRestFulConnect(SScript *script, char *user, char *pass) {
char command[4096]; char command[4096];
sprintf(command, "curl 127.0.0.1:6020/rest/login/%s/%s", user, pass); sprintf(command, "curl 127.0.0.1:6041/rest/login/%s/%s", user, pass);
bool success = false; bool success = false;
for (int attempt = 0; attempt < 10; ++attempt) { for (int attempt = 0; attempt < 10; ++attempt) {
...@@ -815,7 +815,7 @@ bool simExecuteNativeSqlCommand(SScript *script, char *rest, bool isSlow) { ...@@ -815,7 +815,7 @@ bool simExecuteNativeSqlCommand(SScript *script, char *rest, bool isSlow) {
bool simExecuteRestFulSqlCommand(SScript *script, char *rest) { bool simExecuteRestFulSqlCommand(SScript *script, char *rest) {
SCmdLine *line = &script->lines[script->linePos]; SCmdLine *line = &script->lines[script->linePos];
char command[4096]; char command[4096];
sprintf(command, "curl -H 'Authorization: Taosd %s' -d \"%s\" 127.0.0.1:6020/rest/sql", script->auth, rest); sprintf(command, "curl -H 'Authorization: Taosd %s' -d \"%s\" 127.0.0.1:6041/rest/sql", script->auth, rest);
int ret = -1; int ret = -1;
for (int attempt = 0; attempt < 10; ++attempt) { for (int attempt = 0; attempt < 10; ++attempt) {
...@@ -947,7 +947,7 @@ bool simExecuteSqlErrorCmd(SScript *script, char *rest) { ...@@ -947,7 +947,7 @@ bool simExecuteSqlErrorCmd(SScript *script, char *rest) {
TAOS_RES* pSql = NULL; TAOS_RES* pSql = NULL;
if (simAsyncQuery) { if (simAsyncQuery) {
char command[4096]; char command[4096];
sprintf(command, "curl -H 'Authorization: Taosd %s' -d '%s' 127.0.0.1:6020/rest/sql", script->auth, rest); sprintf(command, "curl -H 'Authorization: Taosd %s' -d '%s' 127.0.0.1:6041/rest/sql", script->auth, rest);
ret = simExecuteRestFulCommand(script, command); ret = simExecuteRestFulCommand(script, command);
} }
else { else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册