MCPcopy Create free account
hub / github.com/devnullvoid/pvetui / StartVM

Method StartVM

pkg/api/vm_lifecycle.go:9–18  ·  view source on GitHub ↗

StartVM starts a VM or container.

(vm *VM)

Source from the content-addressed store, hash-verified

7
8// StartVM starts a VM or container.
9func (c *Client) StartVM(vm *VM) (string, error) {
10 path := fmt.Sprintf("/nodes/%s/%s/%d/status/start", vm.Node, vm.Type, vm.ID)
11
12 var response map[string]interface{}
13 if err := c.PostWithResponse(path, nil, &response); err != nil {
14 return "", err
15 }
16
17 return c.extractUPID(response)
18}
19
20// StopVM stops a VM or container.
21func (c *Client) StopVM(vm *VM) (string, error) {

Callers 3

TestPVEMockAPIFunction · 0.95
StartVMFunction · 0.80
newGuestsStartCmdFunction · 0.80

Calls 2

PostWithResponseMethod · 0.95
extractUPIDMethod · 0.95

Tested by 1

TestPVEMockAPIFunction · 0.76