支持策略创建、删除,脚本列表、创建、删除、获取、使用
This commit is contained in:
@@ -14,13 +14,25 @@ const (
|
||||
taskDeletePath = "/saas/task/delete"
|
||||
taskRunPath = "/saas/task/run"
|
||||
targetListPath = "/saas/target/list"
|
||||
targetCreatePath = "/saas/target/create"
|
||||
targetDeletePath = "/saas/target/delete"
|
||||
bindSetPath = "/saas/bind/set"
|
||||
bindDeletePath = "/saas/bind/delete"
|
||||
scriptRunPath = "/saas/script/run"
|
||||
scriptCreatePath = "/saas/script/create"
|
||||
scriptListPath = "/saas/script/list"
|
||||
scriptDeletePath = "/saas/script/delete"
|
||||
scriptGetPath = "/saas/script/get"
|
||||
scriptUsePath = "/saas/script/use"
|
||||
expListPath = "/saas/exp/list"
|
||||
expGetPath = "/saas/exp/get"
|
||||
)
|
||||
|
||||
type Auth struct {
|
||||
Account string
|
||||
Token string
|
||||
}
|
||||
|
||||
type ApiUrls struct {
|
||||
BaseUrl string
|
||||
InfoPath string
|
||||
@@ -35,9 +47,16 @@ type ApiUrls struct {
|
||||
TaskUploadPath string
|
||||
TaskDownloadPath string
|
||||
TargetListPath string
|
||||
TargetCreatePath string
|
||||
TargetDeletePath string
|
||||
BindSetPath string
|
||||
BindDeletePath string
|
||||
ScriptRunPath string
|
||||
ScriptCreatePath string
|
||||
ScriptListPath string
|
||||
ScriptDeletePath string
|
||||
ScriptGetPath string
|
||||
ScriptUsePath string
|
||||
ExpListPath string
|
||||
ExpGetPath string
|
||||
}
|
||||
@@ -49,79 +68,76 @@ func InitAPIUrl(c *ApiUrls) *ApiUrls {
|
||||
} else {
|
||||
r.BaseUrl = baseUrl
|
||||
}
|
||||
|
||||
if c.InfoPath != "" {
|
||||
r.InfoPath = c.InfoPath
|
||||
} else {
|
||||
r.InfoPath = infoPath
|
||||
}
|
||||
|
||||
if c.WritePath != "" {
|
||||
r.WritePath = c.WritePath
|
||||
} else {
|
||||
r.WritePath = writePath
|
||||
}
|
||||
|
||||
if c.ReadPath != "" {
|
||||
r.ReadPath = c.ReadPath
|
||||
} else {
|
||||
r.ReadPath = readPath
|
||||
}
|
||||
|
||||
if c.ColumnWritePath != "" {
|
||||
r.ColumnWritePath = c.ColumnWritePath
|
||||
} else {
|
||||
r.ColumnWritePath = columnWritePath
|
||||
}
|
||||
|
||||
if c.TaskCreatePath != "" {
|
||||
r.TaskCreatePath = c.TaskCreatePath
|
||||
} else {
|
||||
r.TaskCreatePath = taskCreatePath
|
||||
}
|
||||
|
||||
if c.TaskListPath != "" {
|
||||
r.TaskListPath = c.TaskListPath
|
||||
} else {
|
||||
r.TaskListPath = taskListPath
|
||||
}
|
||||
|
||||
if c.TaskInfoPath != "" {
|
||||
r.TaskInfoPath = c.TaskInfoPath
|
||||
} else {
|
||||
r.TaskInfoPath = taskInfoPath
|
||||
}
|
||||
|
||||
if c.TaskDeletePath != "" {
|
||||
r.TaskDeletePath = c.TaskDeletePath
|
||||
} else {
|
||||
r.TaskDeletePath = taskDeletePath
|
||||
}
|
||||
|
||||
if c.TaskRunPath != "" {
|
||||
r.TaskRunPath = c.TaskRunPath
|
||||
} else {
|
||||
r.TaskRunPath = taskRunPath
|
||||
}
|
||||
|
||||
if c.TaskUploadPath != "" {
|
||||
r.TaskUploadPath = c.TaskUploadPath
|
||||
} else {
|
||||
r.TaskUploadPath = taskUploadPath
|
||||
}
|
||||
|
||||
if c.TaskDownloadPath != "" {
|
||||
r.TaskDownloadPath = c.TaskDownloadPath
|
||||
} else {
|
||||
r.TaskDownloadPath = taskDownloadPath
|
||||
}
|
||||
|
||||
if c.TargetListPath != "" {
|
||||
r.TargetListPath = c.TargetListPath
|
||||
} else {
|
||||
r.TargetListPath = targetListPath
|
||||
}
|
||||
|
||||
if c.TargetCreatePath != "" {
|
||||
r.TargetCreatePath = c.TargetCreatePath
|
||||
} else {
|
||||
r.TargetCreatePath = targetCreatePath
|
||||
}
|
||||
if c.TargetDeletePath != "" {
|
||||
r.TargetDeletePath = c.TargetDeletePath
|
||||
} else {
|
||||
r.TargetDeletePath = targetDeletePath
|
||||
}
|
||||
if c.BindSetPath != "" {
|
||||
r.BindSetPath = c.BindSetPath
|
||||
} else {
|
||||
@@ -140,6 +156,36 @@ func InitAPIUrl(c *ApiUrls) *ApiUrls {
|
||||
r.ScriptRunPath = scriptRunPath
|
||||
}
|
||||
|
||||
if c.ScriptCreatePath != "" {
|
||||
r.ScriptCreatePath = c.ScriptCreatePath
|
||||
} else {
|
||||
r.ScriptCreatePath = scriptCreatePath
|
||||
}
|
||||
|
||||
if c.ScriptListPath != "" {
|
||||
r.ScriptListPath = c.ScriptListPath
|
||||
} else {
|
||||
r.ScriptListPath = scriptListPath
|
||||
}
|
||||
|
||||
if c.ScriptDeletePath != "" {
|
||||
r.ScriptDeletePath = c.ScriptDeletePath
|
||||
} else {
|
||||
r.ScriptDeletePath = scriptDeletePath
|
||||
}
|
||||
|
||||
if c.ScriptGetPath != "" {
|
||||
r.ScriptGetPath = c.ScriptGetPath
|
||||
} else {
|
||||
r.ScriptGetPath = scriptGetPath
|
||||
}
|
||||
|
||||
if c.ScriptUsePath != "" {
|
||||
r.ScriptUsePath = c.ScriptUsePath
|
||||
} else {
|
||||
r.ScriptUsePath = scriptUsePath
|
||||
}
|
||||
|
||||
if c.ExpListPath != "" {
|
||||
r.ExpListPath = c.ExpListPath
|
||||
} else {
|
||||
@@ -154,8 +200,3 @@ func InitAPIUrl(c *ApiUrls) *ApiUrls {
|
||||
|
||||
return r
|
||||
}
|
||||
|
||||
type Auth struct {
|
||||
Account string
|
||||
Token string
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user