V2.7 增加agent执行器

This commit is contained in:
georgehao
2019-07-03 22:31:27 +08:00
parent c3a89e9243
commit 37fb659c4e
48 changed files with 2832 additions and 513 deletions

View File

@@ -16,22 +16,22 @@ import (
)
type TaskServer struct {
Id int
GroupId int
Id int
GroupId int
ConnectionType int
ServerName string
ServerAccount string
ServerOuterIp string
ServerIp string
Port int
Password string
PrivateKeySrc string
PublicKeySrc string
Type int
Detail string
CreateTime int64
UpdateTime int64
Status int
ServerName string
ServerAccount string
ServerOuterIp string
ServerIp string
Port int
Password string
PrivateKeySrc string
PublicKeySrc string
Type int
Detail string
CreateTime int64
UpdateTime int64
Status int
}
func (t *TaskServer) TableName() string {
@@ -97,6 +97,20 @@ func TaskServerGetById(id int) (*TaskServer, error) {
return obj, nil
}
func TaskServerForActuator(serverIp string, port int) int {
serverFilters := make([]interface{}, 0)
serverFilters = append(serverFilters, "status__in", []int{0, 1})
serverFilters = append(serverFilters, "server_ip", serverIp)
serverFilters = append(serverFilters, "port", port)
server, _ := TaskServerGetList(1, 1, serverFilters...)
if len(server) == 1 {
return server[0].Id
}
return 0
}
//
func TaskServerGetByIds(ids string) ([]*TaskServer, int64) {