This program is used to process the files in the command folder and remove the files after processing. After that, the program monitors the command folder and repeats the above steps when there are files in the command folder until there are no files in the command folder. When the program starts, the user needs to specify the path of the command folder in the configuration file, and then the user only needs to place the edited command file in the command folder.
Field | Optional | Type | Description |
---|---|---|---|
commands | false | array | Command set |
url | false | string | http request path |
method | false | string | http request method |
description | True | string | Operation description |
data | false for creation | json obj | Creation content |
port: 9081 //kuiper port
timeout: 500 //Timeout for executing a command (unit: ms)
intervalTime: 60 //interval of Checking the command folder (unit: seconds)
ip: "127.0.0.1" //kuiper ip adress
logPath: "./log/kubeedge.log" //Log save path
commandDir: "./sample/" //Command folder path
Execute the command of go build -o tools/kubeedge/kubeedge tools/kubeedge/main.go
to generate the kubeedge program.
{
"commands":[
{
"url":"/streams",
"description":"create stream1",
"method":"post",
"data":{
"sql":"create stream stream1 (id bigint, name string, score float) WITH ( datasource = \"topic/temperature\", FORMAT = \"json\", KEY = \"id\");"
}
}]
}
{
"commands":[
{
"url":"/streams",
"description":"list stream",
"method":"get"
}]
}
{
"commands":[
{
"url":"/streams/stream1",
"description":"get stream1",
"method":"get"
}]
}
{
"commands":[
{
"url":"/streams/stream1",
"description":"del stream1",
"method":"delete"
}]
}
{
"commands":[
{
"url":"/rules",
"description":"create rule1",
"method":"post",
"data":{
"id":"rule1",
"sql":"SELECT * FROM stream1",
"actions":[
{
"log":{
}
}]
}
}]
}
{
"commands":[
{
"url":"/rules",
"description":"list rule",
"method":"get"
}]
}
{
"commands":[
{
"url":"/rules/rule1",
"description":"get rule1",
"method":"get"
}]
}
{
"commands":[
{
"url":"/rules/rule1",
"description":"del rule1",
"method":"delete"
}]
}
{
"commands":[
{
"url":"/rules/rule1/stop",
"description":"stop rule1",
"method":"post"
}]
}
{
"commands":[
{
"url":"/rules/rule1/start",
"description":"start rule1",
"method":"post"
}]
}
{
"commands":[
{
"url":"/rules/rule1/restart",
"description":"restart rule1",
"method":"post"
}]
}
{
"commands":[
{
"url":"/rules/rule1/status",
"description":"get rule1 status",
"method":"get"
}]
}
{
"commands":[
{
"url":"/streams",
"description":"create stream1",
"method":"post",
"data":{
"sql":"create stream stream1 (id bigint, name string, score float) WITH ( datasource = \"topic/temperature\", FORMAT = \"json\", KEY = \"id\");"
}
},
{
"url":"/streams",
"description":"create stream2",
"method":"post",
"data":{
"sql":"create stream stream2 (id bigint, name string, score float) WITH ( datasource = \"topic/temperature\", FORMAT = \"json\", KEY = \"id\");"
}
},
{
"url":"/streams",
"description":"list stream",
"method":"get"
},
{
"url":"/streams/stream1",
"description":"get stream1",
"method":"get"
},
{
"url":"/streams/stream2",
"description":"del stream2",
"method":"delete"
},
{
"url":"/rules",
"description":"create rule1",
"method":"post",
"data":{
"id":"rule1",
"sql":"SELECT * FROM stream1",
"actions":[
{
"log":{
}
}]
}
},
{
"url":"/rules",
"description":"create rule2",
"method":"post",
"data":{
"id":"rule2",
"sql":"SELECT * FROM stream1",
"actions":[
{
"log":{
}
}]
}
},
{
"url":"/rules",
"description":"list rule",
"method":"get"
},
{
"url":"/rules/rule1",
"description":"get rule1",
"method":"get"
},
{
"url":"/rules/rule2",
"description":"del rule2",
"method":"delete"
},
{
"url":"/rules/rule1/stop",
"description":"stop rule1",
"method":"post"
},
{
"url":"/rules/rule1/start",
"description":"start rule1",
"method":"post"
},
{
"url":"/rules/rule1/restart",
"description":"restart rule1",
"method":"post"
},
{
"url":"/rules/rule1/status",
"description":"get rule1 status",
"method":"get"
}]
}