Documentation ¶
Overview ¶
Package powercontrol implements API functions residing under /powercontrol. This path contains methods for querying and setting the power state of VMs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrSet is raised if the power state of a VM could not be set. ErrSet = errors.New("could not set powerstate of VM") // ErrInvalidState is raised if the API retuned an unknown power state. ErrInvalidState = errors.New("invalid power state received") // OnRequest indicates that the VM shall be on. OnRequest Request = "on" // HardRebootRequest indicates that the VM shall be rebooted without involving the OS. This is currently broken in API. HardRebootRequest Request = "hard_reboot" // HardShutdownRequest indicates that the VM shall shut down without involving the OS. This is currently broken in API. HardShutdownRequest Request = "hard_shutdown" // RebootRequest indicates that the VM shall be rebooted. RebootRequest Request = "reboot" // ShutdownRequest indicates that the VM shall be shut down. ShutdownRequest Request = "shutdown" // OnState indicates that the VM is on. OnState State = "VM_POWER_STATE_POWERED_ON" // OffState indicates that the VM is off. OffState State = "VM_POWER_STATE_POWERED_OFF" )
Functions ¶
This section is empty.
Types ¶
type API ¶
type API interface { Get(ctx context.Context, vmIdentifier string) (State, error) // Do not use this, its broken. Set(ctx context.Context, vmIdentifier string, request Request) (Task, error) AwaitCompletion(ctx context.Context, vmID, taskID string) error }
API contains methods for VM power control.
Click to show internal directories.
Click to hide internal directories.