Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
so-operation-api
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
smart-operation
so-operation-api
Commits
f12500f6
Commit
f12500f6
authored
Jul 07, 2023
by
陈子龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
自动化运维 立即执行 fix
parent
478ef3ef
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
src/bean/vo/request/task_manage.go
src/bean/vo/request/task_manage.go
+5
-5
src/controller/task_manage.go
src/controller/task_manage.go
+1
-1
src/service/task_manage.go
src/service/task_manage.go
+1
-1
No files found.
src/bean/vo/request/task_manage.go
View file @
f12500f6
...
@@ -33,10 +33,10 @@ type ListTaskManageReq struct {
...
@@ -33,10 +33,10 @@ type ListTaskManageReq struct {
}
}
type
ExecScriptReq
struct
{
type
ExecScriptReq
struct
{
TaskId
int
`
json
:"task_id" binding:"required"`
//主机分组id
TaskId
int
`
form
:"task_id" binding:"required"`
//主机分组id
HostGroupId
int
`form:"host_group_id" binding:"required"`
//主机分组id
HostGroupId
int
`form:"host_group_id" binding:"required"`
//主机分组id
Type
int
`
json
:"type" binding:"oneof=1 2"`
//脚本额外变量类型1yaml 2json
Type
int
`
form
:"type" binding:"oneof=1 2"`
//脚本额外变量类型1yaml 2json
Value
string
`
json
:"value"`
//脚本额外变量值
Value
string
`
form
:"value"`
//脚本额外变量值
Script
string
`
json
:"script"`
//执行脚本
Script
string
`
form
:"script"`
//执行脚本
YmlFileName
string
`
json
:"yml_file_name"`
//执行脚本url
YmlFileName
string
`
form
:"yml_file_name"`
//执行脚本url
}
}
src/controller/task_manage.go
View file @
f12500f6
...
@@ -123,7 +123,7 @@ func ListTaskManage(c *gin.Context) {
...
@@ -123,7 +123,7 @@ func ListTaskManage(c *gin.Context) {
func
ExecScript
(
c
*
gin
.
Context
)
{
func
ExecScript
(
c
*
gin
.
Context
)
{
var
req
request
.
ExecScriptReq
var
req
request
.
ExecScriptReq
if
err
:=
c
.
ShouldBind
JSON
(
&
req
);
err
!=
nil
{
if
err
:=
c
.
ShouldBind
(
&
req
);
err
!=
nil
{
SendJsonResponse
(
c
,
resp
.
InvalidParam
.
WithError
(
err
),
nil
)
SendJsonResponse
(
c
,
resp
.
InvalidParam
.
WithError
(
err
),
nil
)
return
return
}
}
...
...
src/service/task_manage.go
View file @
f12500f6
...
@@ -232,7 +232,7 @@ func (t *TaskManageSvc) ExecScript(req request.ExecScriptReq) (err error) {
...
@@ -232,7 +232,7 @@ func (t *TaskManageSvc) ExecScript(req request.ExecScriptReq) (err error) {
//新增任务历史
//新增任务历史
id
,
err
:=
AddExecHistory
(
request
.
AddExecHistory
{
id
,
err
:=
AddExecHistory
(
request
.
AddExecHistory
{
TaskId
:
req
.
TaskId
,
TaskId
:
req
.
TaskId
,
CreateUser
:
t
.
User
.
SystemAccount
,
CreateUser
:
""
,
})
})
if
err
!=
nil
{
if
err
!=
nil
{
return
return
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment