forked from Telmate/proxmox-api-go
-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
a12c5c5
commit ee8e24d
Showing
4 changed files
with
66 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package qemu | ||
|
||
import ( | ||
"github.com/Telmate/proxmox-api-go/cli" | ||
"github.com/Telmate/proxmox-api-go/proxmox" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var qemu_resetCmd = &cobra.Command{ | ||
Use: "reset GUESTID", | ||
Short: "Resets the speciefid guest", | ||
RunE: func(cmd *cobra.Command, args []string) (err error) { | ||
vmr := proxmox.NewVmRef(cli.ValidateIntIDset(args, "GuestID")) | ||
c := cli.NewClient() | ||
_, err = c.StartVm(vmr) | ||
if err == nil { | ||
cli.PrintGuestStatus(qemuCmd.OutOrStdout(), vmr.VmId(), "reset") | ||
} | ||
return | ||
}, | ||
} | ||
|
||
func init() { | ||
qemuCmd.AddCommand(qemu_resetCmd) | ||
} |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package qemu | ||
|
||
import ( | ||
"github.com/Telmate/proxmox-api-go/cli" | ||
"github.com/Telmate/proxmox-api-go/proxmox" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var qemu_resumeCmd = &cobra.Command{ | ||
Use: "resume GUESTID", | ||
Short: "Resumes the speciefid guest", | ||
RunE: func(cmd *cobra.Command, args []string) (err error) { | ||
vmr := proxmox.NewVmRef(cli.ValidateIntIDset(args, "GuestID")) | ||
c := cli.NewClient() | ||
_, err = c.ResumeVm(vmr) | ||
if err == nil { | ||
cli.PrintGuestStatus(qemuCmd.OutOrStdout(), vmr.VmId(), "resumed") | ||
} | ||
return | ||
}, | ||
} | ||
|
||
func init() { | ||
qemuCmd.AddCommand(qemu_resumeCmd) | ||
} |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package qemu | ||
|
||
import ( | ||
"github.com/Telmate/proxmox-api-go/cli/command/guest" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var qemuCmd = &cobra.Command{ | ||
Use: "qemu", | ||
Short: "Commands to interact with the qemu guests on Proxmox", | ||
} | ||
|
||
func init() { | ||
guest.GuestCmd.AddCommand(qemuCmd) | ||
} |