status

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(c HTTPClient) *Client

func (*Client) Index

func (c *Client) Index(ctx context.Context, req IndexRequest) ([]IndexResponse, error)

Index Directory index

func (*Client) VmReboot

func (c *Client) VmReboot(ctx context.Context, req VmRebootRequest) (string, error)

VmReboot Reboot the container by shutting it down, and starting it again. Applies pending changes.

func (*Client) VmResume

func (c *Client) VmResume(ctx context.Context, req VmResumeRequest) (string, error)

VmResume Resume the container.

func (*Client) VmShutdown

func (c *Client) VmShutdown(ctx context.Context, req VmShutdownRequest) (string, error)

VmShutdown Shutdown the container. This will trigger a clean shutdown of the container, see lxc-stop(1) for details.

func (*Client) VmStart

func (c *Client) VmStart(ctx context.Context, req VmStartRequest) (string, error)

VmStart Start the container.

func (*Client) VmStatusCurrent

VmStatusCurrent Get virtual machine status.

func (*Client) VmStop

func (c *Client) VmStop(ctx context.Context, req VmStopRequest) (string, error)

VmStop Stop the container. This will abruptly stop all processes running in the container.

func (*Client) VmSuspend

func (c *Client) VmSuspend(ctx context.Context, req VmSuspendRequest) (string, error)

VmSuspend Suspend the container. This is experimental.

type HTTPClient

type HTTPClient interface {
	Do(context.Context, string, string, interface{}, interface{}) error
}

type IndexRequest

type IndexRequest struct {
	Node string `url:"node" json:"node"` // The cluster node name.
	Vmid int    `url:"vmid" json:"vmid"` // The (unique) ID of the VM.

}

type IndexResponse

type IndexResponse struct {
	Subdir string `url:"subdir" json:"subdir"`
}

type Status added in v0.0.15

type Status string
const (
	Status_STOPPED Status = "stopped"
	Status_RUNNING Status = "running"
)

func PtrStatus added in v0.0.15

func PtrStatus(i Status) *Status

type VmRebootRequest

type VmRebootRequest struct {
	Node string `url:"node" json:"node"` // The cluster node name.
	Vmid int    `url:"vmid" json:"vmid"` // The (unique) ID of the VM.

	// The following parameters are optional
	Timeout *int `url:"timeout,omitempty" json:"timeout,omitempty"` // Wait maximal timeout seconds for the shutdown.
}

type VmResumeRequest

type VmResumeRequest struct {
	Node string `url:"node" json:"node"` // The cluster node name.
	Vmid int    `url:"vmid" json:"vmid"` // The (unique) ID of the VM.

}

type VmShutdownRequest

type VmShutdownRequest struct {
	Node string `url:"node" json:"node"` // The cluster node name.
	Vmid int    `url:"vmid" json:"vmid"` // The (unique) ID of the VM.

	// The following parameters are optional
	Forcestop *util.PVEBool `url:"forceStop,omitempty" json:"forceStop,omitempty"` // Make sure the Container stops.
	Timeout   *int          `url:"timeout,omitempty" json:"timeout,omitempty"`     // Wait maximal timeout seconds.
}

type VmStartRequest

type VmStartRequest struct {
	Node string `url:"node" json:"node"` // The cluster node name.
	Vmid int    `url:"vmid" json:"vmid"` // The (unique) ID of the VM.

	// The following parameters are optional
	Debug    *util.PVEBool `url:"debug,omitempty" json:"debug,omitempty"`       // If set, enables very verbose debug log-level on start.
	Skiplock *util.PVEBool `url:"skiplock,omitempty" json:"skiplock,omitempty"` // Ignore locks - only root is allowed to use this option.
}

type VmStatusCurrentRequest

type VmStatusCurrentRequest struct {
	Node string `url:"node" json:"node"` // The cluster node name.
	Vmid int    `url:"vmid" json:"vmid"` // The (unique) ID of the VM.

}

type VmStatusCurrentResponse

type VmStatusCurrentResponse struct {
	Ha     map[string]interface{} `url:"ha" json:"ha"`         // HA manager service status.
	Status Status                 `url:"status" json:"status"` // LXC Container status.
	Vmid   int                    `url:"vmid" json:"vmid"`     // The (unique) ID of the VM.

	// The following parameters are optional
	Cpus    *float64 `url:"cpus,omitempty" json:"cpus,omitempty"`       // Maximum usable CPUs.
	Lock    *string  `url:"lock,omitempty" json:"lock,omitempty"`       // The current config lock, if any.
	Maxdisk *int     `url:"maxdisk,omitempty" json:"maxdisk,omitempty"` // Root disk size in bytes.
	Maxmem  *int     `url:"maxmem,omitempty" json:"maxmem,omitempty"`   // Maximum memory in bytes.
	Maxswap *int     `url:"maxswap,omitempty" json:"maxswap,omitempty"` // Maximum SWAP memory in bytes.
	Name    *string  `url:"name,omitempty" json:"name,omitempty"`       // Container name.
	Tags    *string  `url:"tags,omitempty" json:"tags,omitempty"`       // The current configured tags, if any.
	Uptime  *int     `url:"uptime,omitempty" json:"uptime,omitempty"`   // Uptime.
}

type VmStopRequest

type VmStopRequest struct {
	Node string `url:"node" json:"node"` // The cluster node name.
	Vmid int    `url:"vmid" json:"vmid"` // The (unique) ID of the VM.

	// The following parameters are optional
	Skiplock *util.PVEBool `url:"skiplock,omitempty" json:"skiplock,omitempty"` // Ignore locks - only root is allowed to use this option.
}

type VmSuspendRequest

type VmSuspendRequest struct {
	Node string `url:"node" json:"node"` // The cluster node name.
	Vmid int    `url:"vmid" json:"vmid"` // The (unique) ID of the VM.

}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL