-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ian Stahnke
committed
Feb 25, 2018
1 parent
3775be5
commit 77740a8
Showing
5 changed files
with
60 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
package f5 | ||
|
||
type BashCommand struct { | ||
Command string `json:"command"` | ||
UtilCommandArgs string `json:"utilCmdArgs"` | ||
Command string `json:"command"` | ||
UtilCommandArgs string `json:"utilCmdArgs"` | ||
} | ||
|
||
type BashCommandResult struct { | ||
Kind string `json:"kind"` | ||
Command string `json:"command"` | ||
UtilCommandArgs string `json:"utilCmdArgs"` | ||
CommandResult string `json:"commandResult"` | ||
Kind string `json:"kind"` | ||
Command string `json:"command"` | ||
UtilCommandArgs string `json:"utilCmdArgs"` | ||
CommandResult string `json:"commandResult"` | ||
} | ||
|
||
func (f *Device) Run(command string) (error, *BashCommandResult) { | ||
u := f.Proto + "://" + f.Hostname + "/mgmt/tm/util/bash" | ||
b := BashCommand { Command:"run", UtilCommandArgs:"-c \"" + command + "\"" } | ||
b := BashCommand{Command: "run", UtilCommandArgs: "-c \"" + command + "\""} | ||
r := BashCommandResult{} | ||
err, _ := f.sendRequest(u, POST, &b, &r) | ||
if err != nil { | ||
return err, nil | ||
} | ||
return nil, &r | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters