增加lua调试功能
This commit is contained in:
@@ -8,7 +8,6 @@ const (
|
||||
columnWritePath = "/saas/column_write"
|
||||
taskCreatePath = "/saas/task/create"
|
||||
taskListPath = "/saas/task/list"
|
||||
taskCancelPath = "/saas/task/delete"
|
||||
taskInfoPath = "/saas/task/info"
|
||||
taskUploadPath = "/saas/task/upload"
|
||||
taskDownloadPath = "/saas/task/download"
|
||||
@@ -17,6 +16,7 @@ const (
|
||||
targetListPath = "/saas/target/list"
|
||||
bindSetPath = "/saas/bind/set"
|
||||
bindDeletePath = "/saas/bind/delete"
|
||||
scriptRunPath = "/saas/script/run"
|
||||
)
|
||||
|
||||
type ApiUrls struct {
|
||||
@@ -35,6 +35,7 @@ type ApiUrls struct {
|
||||
TargetListPath string
|
||||
BindSetPath string
|
||||
BindDeletePath string
|
||||
ScriptRunPath string
|
||||
}
|
||||
|
||||
func InitAPIUrl(c *ApiUrls) *ApiUrls {
|
||||
@@ -129,6 +130,12 @@ func InitAPIUrl(c *ApiUrls) *ApiUrls {
|
||||
r.BindDeletePath = bindDeletePath
|
||||
}
|
||||
|
||||
if c.ScriptRunPath != "" {
|
||||
r.ScriptRunPath = c.ScriptRunPath
|
||||
} else {
|
||||
r.ScriptRunPath = scriptRunPath
|
||||
}
|
||||
|
||||
return r
|
||||
}
|
||||
|
||||
|
||||
@@ -103,6 +103,11 @@ func (c *SaasClient) BindDelete(saasReq *saasapi.SaasReq) (saasRes *saasapi.Saas
|
||||
return c.post(postUrl, saasReq)
|
||||
}
|
||||
|
||||
func (c *SaasClient) ScriptRun(saasReq *saasapi.SaasReq) (saasRes *saasapi.SaasRes, err error) {
|
||||
postUrl := c.makeUrl(c.ApiUrls.BaseUrl, c.ApiUrls.ScriptRunPath)
|
||||
return c.post(postUrl, saasReq)
|
||||
}
|
||||
|
||||
func (c *SaasClient) makeUrl(baseUrl, path string, params ...string) string {
|
||||
url, err := url.Parse(baseUrl)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user