未验证 提交 278118dd 编写于 作者: S Shengliang Guan 提交者: GitHub

Merge pull request #2527 from taosdata/hotfix/crash

change http code
...@@ -441,7 +441,7 @@ void httpJsonPairStatus(JsonBuf* buf, int code) { ...@@ -441,7 +441,7 @@ void httpJsonPairStatus(JsonBuf* buf, int code) {
} else { } else {
httpJsonPair(buf, "status", 6, "error", 5); httpJsonPair(buf, "status", 6, "error", 5);
httpJsonItemToken(buf); httpJsonItemToken(buf);
httpJsonPairIntVal(buf, "code", 4, code); httpJsonPairIntVal(buf, "code", 4, code & 0XFFFF);
httpJsonItemToken(buf); httpJsonItemToken(buf);
if (code == TSDB_CODE_MND_DB_NOT_SELECTED) { if (code == TSDB_CODE_MND_DB_NOT_SELECTED) {
httpJsonPair(buf, "desc", 4, "failed to create database", 23); httpJsonPair(buf, "desc", 4, "failed to create database", 23);
......
...@@ -174,9 +174,9 @@ void httpSendErrorRespWithDesc(HttpContext *pContext, int errNo, char *desc) { ...@@ -174,9 +174,9 @@ void httpSendErrorRespWithDesc(HttpContext *pContext, int errNo, char *desc) {
} }
if (desc == NULL) { if (desc == NULL) {
httpSendErrorRespImp(pContext, httpCode, httpCodeStr, errNo + 1000, httpMsg[errNo]); httpSendErrorRespImp(pContext, httpCode, httpCodeStr, errNo + 5000, httpMsg[errNo]);
} else { } else {
httpSendErrorRespImp(pContext, httpCode, httpCodeStr, errNo + 1000, desc); httpSendErrorRespImp(pContext, httpCode, httpCodeStr, errNo + 5000, desc);
} }
} }
...@@ -184,7 +184,8 @@ void httpSendErrorResp(HttpContext *pContext, int errNo) { httpSendErrorRespWith ...@@ -184,7 +184,8 @@ void httpSendErrorResp(HttpContext *pContext, int errNo) { httpSendErrorRespWith
void httpSendTaosdErrorResp(HttpContext *pContext, int errCode) { void httpSendTaosdErrorResp(HttpContext *pContext, int errCode) {
int httpCode = 400; int httpCode = 400;
httpSendErrorRespImp(pContext, httpCode, "Bad Request", 1000, (char*)tstrerror(errCode));
httpSendErrorRespImp(pContext, httpCode, "Bad Request", errCode & 0XFFFF, (char*)tstrerror(errCode));
} }
void httpSendTaosdInvalidSqlErrorResp(HttpContext *pContext, char* errMsg) { void httpSendTaosdInvalidSqlErrorResp(HttpContext *pContext, char* errMsg) {
...@@ -200,7 +201,7 @@ void httpSendTaosdInvalidSqlErrorResp(HttpContext *pContext, char* errMsg) { ...@@ -200,7 +201,7 @@ void httpSendTaosdInvalidSqlErrorResp(HttpContext *pContext, char* errMsg) {
} else {} } else {}
} }
httpSendErrorRespImp(pContext, httpCode, "Bad Request", 1000, temp); httpSendErrorRespImp(pContext, httpCode, "Bad Request", TSDB_CODE_TSC_INVALID_SQL & 0XFFFF, temp);
} }
void httpSendSuccResp(HttpContext *pContext, char *desc) { void httpSendSuccResp(HttpContext *pContext, char *desc) {
......
...@@ -54,43 +54,43 @@ print =============== step2 - login ...@@ -54,43 +54,43 @@ print =============== step2 - login
system_content curl 127.0.0.1:6020/grafana/ system_content curl 127.0.0.1:6020/grafana/
print 1-> $system_content print 1-> $system_content
if $system_content != @{"status":"error","code":1011,"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:6020/grafana/xx
print 2-> $system_content print 2-> $system_content
if $system_content != @{"status":"error","code":1011,"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:6020/grafana/login/xx/xx/
print 3-> $system_content print 3-> $system_content
if $system_content != @{"status":"error","code":1000,"desc":"mnode invalid user"}@ then if $system_content != @{"status":"error","code":849,"desc":"mnode 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:6020/grafana/root/1/123/1/1/3
print 4-> $system_content print 4-> $system_content
if $system_content != @{"status":"error","code":1011,"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:6020/grafana/login/1/root/1/
print 5-> $system_content print 5-> $system_content
if $system_content != @{"status":"error","code":1000,"desc":"mnode invalid user"}@ then if $system_content != @{"status":"error","code":849,"desc":"mnode 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:6020/grafana/root/1/login
print 6-> $system_content print 6-> $system_content
if $system_content != @{"status":"error","code":1010,"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:6020/grafana/root/1/login
print 7-> $system_content print 7-> $system_content
if $system_content != @{"status":"error","code":1010,"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
......
...@@ -77,7 +77,7 @@ endi ...@@ -77,7 +77,7 @@ endi
system_content curl 127.0.0.1:6020/rest/login/u2/aabcd_1234 system_content curl 127.0.0.1:6020/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:6020/rest/login/u2/abcd_1234 -----> $system_content
if $system_content != @{"status":"error","code":1000,"desc":"auth failure"}@ then if $system_content != @{"status":"error","code":3,"desc":"auth failure"}@ then
return -1 return -1
endi endi
......
...@@ -14,57 +14,57 @@ print =============== step1 - login ...@@ -14,57 +14,57 @@ print =============== step1 - login
system_content curl 127.0.0.1:6020/rest/ system_content curl 127.0.0.1:6020/rest/
print 1-> $system_content print 1-> $system_content
if $system_content != @{"status":"error","code":1011,"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:6020/rest/xx
print 2-> $system_content print 2-> $system_content
if $system_content != @{"status":"error","code":1011,"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:6020/rest/login
print 3-> $system_content print 3-> $system_content
if $system_content != @{"status":"error","code":1011,"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:6020/rest/login/root
print 4-> $system_content print 4-> $system_content
if $system_content != @{"status":"error","code":1011,"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:6020/rest/login/root/123
print 5-> $system_content print 5-> $system_content
if $system_content != @{"status":"error","code":1000,"desc":"auth failure"}@ then if $system_content != @{"status":"error","code":3,"desc":"auth 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:6020/rest/login/root/123/1/1/3
print 6-> $system_content print 6-> $system_content
if $system_content != @{"status":"error","code":1000,"desc":"auth failure"}@ then if $system_content != @{"status":"error","code":3,"desc":"auth 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:6020/rest/login/root/1
print 7-> $system_content print 7-> $system_content
if $system_content != @{"status":"error","code":1000,"desc":"auth failure"}@ then if $system_content != @{"status":"error","code":3,"desc":"auth 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:6020/rest/login/root/1
print 8-> $system_content print 8-> $system_content
if $system_content != @{"status":"error","code":1010,"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:6020/rest/login/root/1
print 9-> $system_content print 9-> $system_content
if $system_content != @{"status":"error","code":1010,"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
...@@ -93,40 +93,40 @@ endi ...@@ -93,40 +93,40 @@ 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:6020/rest/sql
print 13-> $system_content print 13-> $system_content
if $system_content != @{"status":"error","code":1000,"desc":"mnode database aleady exist"}@ then if $system_content != @{"status":"error","code":897,"desc":"mnode database aleady exist"}@ 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:6020/rest/sql
print 14-> $system_content print 14-> $system_content
if $system_content != @{"status":"error","code":1012,"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:6020/rest/sql
#print 15-> $system_content #print 15-> $system_content
#if $system_content != @{"status":"error","code":1017,"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:6020/rest/sql
#print 16-> $system_content #print 16-> $system_content
#if $system_content != @{"status":"error","code":1017,"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:6020/rest/sql
print 17-> $system_content print 17-> $system_content
if $system_content != @{"status":"error","code":1000,"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:6020/rest/sql
print 18-> $system_content print 18-> $system_content
if $system_content != @{"status":"error","code":1000,"desc":"mnode db not selected"}@ then if $system_content != @{"status":"error","code":896,"desc":"mnode db not selected"}@ then
return -1 return -1
endi endi
...@@ -147,7 +147,7 @@ print =============== step3 - db ...@@ -147,7 +147,7 @@ print =============== step3 - db
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:6020/rest/sql
print 21-> $system_content print 21-> $system_content
if $system_content != @{"status":"error","code":1000,"desc":"mnode invalid table name"}@ then if $system_content != @{"status":"error","code":866,"desc":"mnode invalid table name"}@ then
return -1 return -1
endi endi
......
...@@ -16,224 +16,224 @@ print =============== step1 - parse ...@@ -16,224 +16,224 @@ print =============== step1 - parse
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/ system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/
print $system_content print $system_content
if $system_content != @{"status":"error","code":1022,"desc":"database name can not be null"}@ then if $system_content != @{"status":"error","code":5022,"desc":"database name can not be null"}@ then
return -1 return -1
endi endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'select * from d1.table_admin' -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/ system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'select * from d1.table_admin' -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/
print $system_content print $system_content
if $system_content != @{"status":"error","code":1022,"desc":"database name can not be null"}@ then if $system_content != @{"status":"error","code":5022,"desc":"database name can not be null"}@ then
return -1 return -1
endi endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'select * from d1.table_admin' -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/d123456789012345678901234567890123456 system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'select * from d1.table_admin' -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/d123456789012345678901234567890123456
print $system_content print $system_content
if $system_content != @{"status":"error","code":1023,"desc":"database name too long"}@ then if $system_content != @{"status":"error","code":5023,"desc":"database name too long"}@ then
return -1 return -1
endi endi
system_content curl -u root:taosdata -d '[]' 127.0.0.1:6020/telegraf/db/root/taosdata1 system_content curl -u root:taosdata -d '[]' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content print $system_content
if $system_content != @{"status":"error","code":1027,"desc":"metric name not find"}@ then if $system_content != @{"status":"error","code":5027,"desc":"metric name not find"}@ then
return -1 return -1
endi endi
system_content curl -u root:taosdata -d '{}' 127.0.0.1:6020/telegraf/db/root/taosdata1 system_content curl -u root:taosdata -d '{}' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content print $system_content
if $system_content != @{"status":"error","code":1027,"desc":"metric name not find"}@ then if $system_content != @{"status":"error","code":5027,"desc":"metric name not find"}@ then
return -1 return -1
endi endi
system_content curl -u root:taosdata -d '[{}]' 127.0.0.1:6020/telegraf/db/root/taosdata1 system_content curl -u root:taosdata -d '[{}]' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content print $system_content
if $system_content != @{"status":"error","code":1027,"desc":"metric name not find"}@ then if $system_content != @{"status":"error","code":5027,"desc":"metric name not find"}@ then
return -1 return -1
endi endi
system_content curl -u root:taosdata -d '{"metrics": []}' 127.0.0.1:6020/telegraf/db/root/taosdata1 system_content curl -u root:taosdata -d '{"metrics": []}' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content print $system_content
if $system_content != @{"status":"error","code":1025,"desc":"metrics size is 0"}@ then if $system_content != @{"status":"error","code":5025,"desc":"metrics size is 0"}@ then
return -1 return -1
endi endi
system_content curl -u root:taosdata -d '{"metrics": [{}]}' 127.0.0.1:6020/telegraf/db/root/taosdata1 system_content curl -u root:taosdata -d '{"metrics": [{}]}' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content print $system_content
if $system_content != @{"status":"error","code":1027,"desc":"metric name not find"}@ then if $system_content != @{"status":"error","code":5027,"desc":"metric name not find"}@ then
return -1 return -1
endi endi
system_content curl -u root:taosdata -d '{"metrics": 12}' 127.0.0.1:6020/telegraf/db/root/taosdata1 system_content curl -u root:taosdata -d '{"metrics": 12}' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content print $system_content
if $system_content != @{"status":"error","code":1025,"desc":"metrics size is 0"}@ then if $system_content != @{"status":"error","code":5025,"desc":"metrics size is 0"}@ then
return -1 return -1
endi endi
#system_content curl -u root:taosdata -d '{"metrics": [{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{}]}' 127.0.0.1:6020/telegraf/db/root/taosdata1 #system_content curl -u root:taosdata -d '{"metrics": [{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{}]}' 127.0.0.1:6020/telegraf/db/root/taosdata1
#print $system_content #print $system_content
#if $system_content != @{"status":"error","code":1026,"desc":"metrics size can not more than 50"}@ then #if $system_content != @{"status":"error","code":5026,"desc":"metrics size can not more than 50"}@ then
# return -1 # return -1
#endi #endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1 system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content print $system_content
if $system_content != @{"status":"error","code":1027,"desc":"metric name not find"}@ then if $system_content != @{"status":"error","code":5027,"desc":"metric name not find"}@ then
return -1 return -1
endi endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":111,"tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1 system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":111,"tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content print $system_content
if $system_content != @{"status":"error","code":1028,"desc":"metric name type should be string"}@ then if $system_content != @{"status":"error","code":5028,"desc":"metric name type should be string"}@ then
return -1 return -1
endi endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1 system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content print $system_content
if $system_content != @{"status":"error","code":1029,"desc":"metric name length is 0"}@ then if $system_content != @{"status":"error","code":5029,"desc":"metric name length is 0"}@ then
return -1 return -1
endi endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"a1234567890123456789012345678901234a1234567890123456789012345678901234a1234567890123456789012345678901234a1234567890123456789012345678901234a1234567890123456789012345678901234a1234567890123456789012345678901234a1234567890123456789012345678901234a1234567890123456789012345678901234a1234567890123456789012345678901234a1234567890123456789012345678901234a1234567890123456789012345678901234a1234567890123456789012345678901234","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1 system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"a1234567890123456789012345678901234a1234567890123456789012345678901234a1234567890123456789012345678901234a1234567890123456789012345678901234a1234567890123456789012345678901234a1234567890123456789012345678901234a1234567890123456789012345678901234a1234567890123456789012345678901234a1234567890123456789012345678901234a1234567890123456789012345678901234a1234567890123456789012345678901234a1234567890123456789012345678901234","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content print $system_content
if $system_content != @{"status":"error","code":1030,"desc":"metric name length too long"}@ then if $system_content != @{"status":"error","code":5030,"desc":"metric name length too long"}@ then
return -1 return -1
endi endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"}}' 127.0.0.1:6020/telegraf/db/root/taosdata1 system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"}}' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content print $system_content
if $system_content != @{"status":"error","code":1031,"desc":"timestamp not find"}@ then if $system_content != @{"status":"error","code":5031,"desc":"timestamp not find"}@ then
return -1 return -1
endi endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":""}' 127.0.0.1:6020/telegraf/db/root/taosdata1 system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":""}' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content print $system_content
if $system_content != @{"status":"error","code":1032,"desc":"timestamp type should be integer"}@ then if $system_content != @{"status":"error","code":5032,"desc":"timestamp type should be integer"}@ then
return -1 return -1
endi endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":-1}' 127.0.0.1:6020/telegraf/db/root/taosdata1 system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":-1}' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content print $system_content
if $system_content != @{"status":"error","code":1033,"desc":"timestamp value smaller than 0"}@ then if $system_content != @{"status":"error","code":5033,"desc":"timestamp value smaller than 0"}@ then
return -1 return -1
endi endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1 system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content print $system_content
if $system_content != @{"status":"error","code":1034,"desc":"tags not find"}@ then if $system_content != @{"status":"error","code":5034,"desc":"tags not find"}@ then
return -1 return -1
endi endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1 system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content print $system_content
if $system_content != @{"status":"error","code":1035,"desc":"tags size is 0"}@ then if $system_content != @{"status":"error","code":5035,"desc":"tags size is 0"}@ then
return -1 return -1
endi endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":"","timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1 system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":"","timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content print $system_content
if $system_content != @{"status":"error","code":1035,"desc":"tags size is 0"}@ then if $system_content != @{"status":"error","code":5035,"desc":"tags size is 0"}@ then
return -1 return -1
endi endi
#system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor","host":"windows","instance":"1","objectname":"Processor","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata #system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor","host":"windows","instance":"1","objectname":"Processor","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata
#print $system_content #print $system_content
#if $system_content != @{"status":"error","code":1036,"desc":"tags size too long"}@ then #if $system_content != @{"status":"error","code":5036,"desc":"tags size too long"}@ then
# return -1 # return -1
#endi #endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1 system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content print $system_content
if $system_content != @{"status":"error","code":1035,"desc":"tags size is 0"}@ then if $system_content != @{"status":"error","code":5035,"desc":"tags size is 0"}@ then
return -1 return -1
endi endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"":"windows"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1 system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"":"windows"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content print $system_content
if $system_content != @{"status":"error","code":1038,"desc":"tag name is null"}@ then if $system_content != @{"status":"error","code":5038,"desc":"tag name is null"}@ then
return -1 return -1
endi endi
#system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host111111111111222222222222222222222":""},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1 #system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host111111111111222222222222222222222":""},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1
#print $system_content #print $system_content
#if $system_content != @{"status":"error","code":1039,"desc":"tag name length too long"}@ then #if $system_content != @{"status":"error","code":5039,"desc":"tag name length too long"}@ then
# return -1 # return -1
#endi #endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":true},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1 system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":true},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content print $system_content
if $system_content != @{"status":"error","code":1040,"desc":"tag value type should be number or string"}@ then if $system_content != @{"status":"error","code":5040,"desc":"tag value type should be number or string"}@ then
return -1 return -1
endi endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":""},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1 system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":""},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content print $system_content
if $system_content != @{"status":"error","code":1041,"desc":"tag value is null"}@ then if $system_content != @{"status":"error","code":5041,"desc":"tag value is null"}@ then
return -1 return -1
endi endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"1022":"111"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1 system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"5022":"111"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content print $system_content
if $system_content != @{"status":"error","code":1042,"desc":"table is null"}@ then if $system_content != @{"status":"error","code":5042,"desc":"table is null"}@ then
return -1 return -1
endi endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"host111111111111222222222222222222222host111111111111222222222222222222222host111111111111222222222222222222222host111111111111222222222222222222222host111111111111222222222222222222222host111111111111222222222222222222222host111111111111222222222222222222222host111111111111222222222222222222222"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1 system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"host111111111111222222222222222222222host111111111111222222222222222222222host111111111111222222222222222222222host111111111111222222222222222222222host111111111111222222222222222222222host111111111111222222222222222222222host111111111111222222222222222222222host111111111111222222222222222222222"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content print $system_content
if $system_content != @{"status":"error","code":1043,"desc":"table name length too long"}@ then if $system_content != @{"status":"error","code":5043,"desc":"table name length too long"}@ then
return -1 return -1
endi endi
system_content curl -u root:taosdata -d '{"fields":{},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1 system_content curl -u root:taosdata -d '{"fields":{},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content print $system_content
if $system_content != @{"status":"error","code":1045,"desc":"fields size is 0"}@ then if $system_content != @{"status":"error","code":5045,"desc":"fields size is 0"}@ then
return -1 return -1
endi endi
system_content curl -u root:taosdata -d '{"fields":{"":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1 system_content curl -u root:taosdata -d '{"fields":{"":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content print $system_content
if $system_content != @{"status":"error","code":1048,"desc":"field name is null"}@ then if $system_content != @{"status":"error","code":5048,"desc":"field name is null"}@ then
return -1 return -1
endi endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":"","Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1 system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":"","Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content print $system_content
if $system_content != @{"status":"error","code":1051,"desc":"field value is null"}@ then if $system_content != @{"status":"error","code":5051,"desc":"field value is null"}@ then
return -1 return -1
endi endi
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":true,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1 system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":true,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1
print $system_content print $system_content
if $system_content != @{"status":"error","code":1050,"desc":"field value type should be number or string"}@ then if $system_content != @{"status":"error","code":5050,"desc":"field value type should be number or string"}@ then
return -1 return -1
endi endi
......
...@@ -113,11 +113,11 @@ echo "logDir $LOG_DIR" >> $TAOS_CFG ...@@ -113,11 +113,11 @@ echo "logDir $LOG_DIR" >> $TAOS_CFG
echo "mDebugFlag 135" >> $TAOS_CFG echo "mDebugFlag 135" >> $TAOS_CFG
echo "sdbDebugFlag 135" >> $TAOS_CFG echo "sdbDebugFlag 135" >> $TAOS_CFG
echo "dDebugFlag 135" >> $TAOS_CFG echo "dDebugFlag 135" >> $TAOS_CFG
echo "vDebugFlag 143" >> $TAOS_CFG echo "vDebugFlag 135" >> $TAOS_CFG
echo "cDebugFlag 135" >> $TAOS_CFG echo "cDebugFlag 135" >> $TAOS_CFG
echo "jnidebugFlag 135" >> $TAOS_CFG echo "jnidebugFlag 135" >> $TAOS_CFG
echo "odbcdebugFlag 135" >> $TAOS_CFG echo "odbcdebugFlag 135" >> $TAOS_CFG
echo "httpDebugFlag 135" >> $TAOS_CFG echo "httpDebugFlag 143" >> $TAOS_CFG
echo "monitorDebugFlag 131" >> $TAOS_CFG echo "monitorDebugFlag 131" >> $TAOS_CFG
echo "mqttDebugFlag 131" >> $TAOS_CFG echo "mqttDebugFlag 131" >> $TAOS_CFG
echo "qdebugFlag 135" >> $TAOS_CFG echo "qdebugFlag 135" >> $TAOS_CFG
......
...@@ -33,49 +33,49 @@ print =============== step1 - login ...@@ -33,49 +33,49 @@ print =============== step1 - login
system_content curl 127.0.0.1:6020/admin/ system_content curl 127.0.0.1:6020/admin/
print 1-> $system_content print 1-> $system_content
if $system_content != @{"status":"error","code":1011,"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:6020/admin/xx
print 2-> $system_content print 2-> $system_content
if $system_content != @{"status":"error","code":1011,"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:6020/admin/login
print 3-> $system_content print 3-> $system_content
if $system_content != @{"status":"error","code":1011,"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:6020/admin/login/root
print 4-> $system_content print 4-> $system_content
if $system_content != @{"status":"error","code":1011,"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:6020/admin/login/root/123
print 5-> $system_content print 5-> $system_content
if $system_content != @{"status":"error","code":1000,"desc":"auth failure"}@ then if $system_content != @{"status":"error","code":3,"desc":"auth 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:6020/admin/login/root/123/1/1/3
print 6-> $system_content print 6-> $system_content
if $system_content != @{"status":"error","code":1000,"desc":"auth failure"}@ then if $system_content != @{"status":"error","code":3,"desc":"auth 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:6020/admin/login/root/1
print 7-> $system_content print 7-> $system_content
if $system_content != @{"status":"error","code":1010,"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:6020/admin/login/root/1
print 8-> $system_content print 8-> $system_content
if $system_content != @{"status":"error","code":1053,"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
...@@ -105,7 +105,7 @@ endi ...@@ -105,7 +105,7 @@ endi
system_content curl 127.0.0.1:6020/admin/logout system_content curl 127.0.0.1:6020/admin/logout
print 11 -----> $system_content print 11 -----> $system_content
if $system_content != @{"status":"error","code":1011,"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
...@@ -168,7 +168,7 @@ print =============== step7 - use dbs ...@@ -168,7 +168,7 @@ 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:6020/admin/all
print 23-> $system_content print 23-> $system_content
if $system_content != @{"status":"error","code":1017,"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
......
...@@ -3,7 +3,6 @@ system sh/stop_dnodes.sh ...@@ -3,7 +3,6 @@ system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c http -v 1 system sh/cfg.sh -n dnode1 -c http -v 1
system sh/cfg.sh -n dnode1 -c wallevel -v 0 system sh/cfg.sh -n dnode1 -c wallevel -v 0
system sh/cfg.sh -n dnode1 -c httpDebugFlag -v 135
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
sleep 3000 sleep 3000
...@@ -14,92 +13,92 @@ print ============================ dnode1 start ...@@ -14,92 +13,92 @@ 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:6020/opentsdb/
print $system_content print $system_content
if $system_content != @{"status":"error","code":1057,"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:6020/opentsdb/db123456789012345678901234567890db
print $system_content print $system_content
if $system_content != @{"status":"error","code":1058,"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:6020/opentsdb/
print $system_content print $system_content
if $system_content != @{"status":"error","code":1057,"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:6020/opentsdb/db/put2
print $system_content print $system_content
if $system_content != @{"status":"error","code":1009,"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:6020/opentsdb/db/put
print $system_content print $system_content
if $system_content != @{"status":"error","code":1060,"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:6020/opentsdb/db/put
print $system_content print $system_content
if $system_content != @{"status":"error","code":1059,"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:6020/opentsdb/db/put
print $system_content print $system_content
if $system_content != @{"status":"error","code":1060,"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:6020/opentsdb/db/put
print $system_content print $system_content
if $system_content != @{"status":"error","code":1062,"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:6020/opentsdb/db/put
print $system_content print $system_content
if $system_content != @{"status":"error","code":1063,"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:6020/opentsdb/db/put
print $system_content print $system_content
if $system_content != @{"status":"error","code":1064,"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:6020/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":-2147482101,"desc":"tsdb timestamp is 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":"tsdb timestamp is 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:6020/opentsdb/db/put
print $system_content print $system_content
if $system_content != @{"status":"error","code":1066,"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:6020/opentsdb/db/put
print $system_content print $system_content
if $system_content != @{"status":"error","code":1067,"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:6020/opentsdb/db/put
print $system_content print $system_content
if $system_content != @{"status":"error","code":1068,"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:6020/opentsdb/db/put
print $system_content print $system_content
if $system_content != @{"status":"error","code":1078,"desc":"value not find"}@ then if $system_content != @{"status":"error","code":5078,"desc":"value not find"}@ then
return -1 return -1
endi endi
...@@ -107,49 +106,49 @@ endi ...@@ -107,49 +106,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:6020/opentsdb/db/put
print $system_content print $system_content
if $system_content != @{"status":"error","code":1069,"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:6020/opentsdb/db/put
print $system_content print $system_content
if $system_content != @{"status":"error","code":1070,"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:6020/opentsdb/db/put
print $system_content print $system_content
if $system_content != @{"status":"error","code":1070,"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:6020/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":-2147482782,"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:6020/opentsdb/db/put
print $system_content print $system_content
if $system_content != @{"status":"error","code":1073,"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:6020/opentsdb/db/put
print $system_content print $system_content
if $system_content != @{"status":"error","code":1074,"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:6020/opentsdb/db/put
print $system_content print $system_content
if $system_content != @{"status":"error","code":1077,"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:6020/opentsdb/db/put
print $system_content print $system_content
if $system_content != @{"status":"error","code":1076,"desc":"tag value is null"}@ then if $system_content != @{"status":"error","code":5076,"desc":"tag value is null"}@ then
return -1 return -1
endi endi
...@@ -175,11 +174,11 @@ if $system_content != @{"status":"succ","head":["ts","value"],"data":[["2012-09- ...@@ -175,11 +174,11 @@ if $system_content != @{"status":"succ","head":["ts","value"],"data":[["2012-09-
endi endi
print =============== step3 - multi-query data print =============== step3 - multi-query data
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846401000,"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:6020/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":1346846401000,"value":18.000000,"tags":{"dc":"lga","group1":"1","host":"web01"},"affected_rows":1,"status":"succ"}},{"datapoint":{"metric":"sys_cpu","stable":"sys_cpu_d_bbb","table":"sys_cpu_d_bbb_lga_1_web02","timestamp":1346846402000,"value":18.000000,"tags":{"dc":"lga","group1":"1","host":"web02"},"affected_rows":1,"status":"succ"}}],"failed":0,"success":2,"affected_rows":2}@ then if $system_content != @{"errors":[{"datapoint":{"metric":"sys_cpu","stable":"sys_cpu_d_bbb","table":"sys_cpu_d_bbb_lga_1_web01","timestamp":1346846405000,"value":18.000000,"tags":{"dc":"lga","group1":"1","host":"web01"},"affected_rows":1,"status":"succ"}},{"datapoint":{"metric":"sys_cpu","stable":"sys_cpu_d_bbb","table":"sys_cpu_d_bbb_lga_1_web02","timestamp":1346846402000,"value":18.000000,"tags":{"dc":"lga","group1":"1","host":"web02"},"affected_rows":1,"status":"succ"}}],"failed":0,"success":2,"affected_rows":2}@ then
return -1 return -1
endi endi
...@@ -187,7 +186,7 @@ system_content curl -u root:taosdata -d 'select * from db.sys_cpu_d_bbb_lga_1_w ...@@ -187,7 +186,7 @@ system_content curl -u root:taosdata -d 'select * from db.sys_cpu_d_bbb_lga_1_w
print $system_content print $system_content
if $system_content != @{"status":"succ","head":["ts","value"],"data":[["2012-09-05 20:00:00.000",18.000000000],["2012-09-05 20:00:01.000",18.000000000]],"rows":2}@ then if $system_content != @{"status":"succ","head":["ts","value"],"data":[["2012-09-05 20:00:00.000",18.000000000],["2012-09-05 20:00:05.000",18.000000000]],"rows":2}@ then
return -1 return -1
endi endi
...@@ -200,7 +199,7 @@ if $system_content != @{"status":"succ","head":["count(*)"],"data":[[3]],"rows": ...@@ -200,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": 1346846401000,"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:6020/opentsdb/db/put?details=false
print $system_content print $system_content
...@@ -212,7 +211,7 @@ system_content curl -u root:taosdata -d 'select * from db.sys_mem_d_bbb_lga_1_w ...@@ -212,7 +211,7 @@ system_content curl -u root:taosdata -d 'select * from db.sys_mem_d_bbb_lga_1_w
print $system_content print $system_content
if $system_content != @{"status":"succ","head":["ts","value"],"data":[["2012-09-05 20:00:00.000",8.000000000],["2012-09-05 20:00:01.000",9.000000000]],"rows":2}@ then if $system_content != @{"status":"succ","head":["ts","value"],"data":[["2012-09-05 20:00:00.000",8.000000000],["2012-09-05 20:00:05.000",9.000000000]],"rows":2}@ then
return -1 return -1
endi endi
...@@ -234,7 +233,7 @@ system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 134 ...@@ -234,7 +233,7 @@ system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 134
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:6020/rest/sql/
print $system_content print $system_content
if $system_content != @{"status":"succ","head":["count(*)"],"data":[[8]],"rows":1}@ then if $system_content != @{"status":"succ","head":["count(*)"],"data":[[7]],"rows":1}@ then
return -1 return -1
endi endi
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册