status

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2023 License: MIT Imports: 1 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) (*VmRebootResponse, 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) (*VmResumeResponse, error)

VmResume Resume the container.

func (*Client) VmShutdown

func (c *Client) VmShutdown(ctx context.Context, req *VmShutdownRequest) (*VmShutdownResponse, 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) (*VmStartResponse, error)

VmStart Start the container.

func (*Client) VmStatusCurrent

func (c *Client) VmStatusCurrent(ctx context.Context, req *VmStatusCurrentRequest) (*VmStatusCurrentResponse, error)

VmStatusCurrent Get virtual machine status.

func (*Client) VmStop

func (c *Client) VmStop(ctx context.Context, req *VmStopRequest) (*VmStopResponse, 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) (*VmSuspendResponse, 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 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 VmRebootResponse

type VmRebootResponse string

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 VmResumeResponse

type VmResumeResponse string

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 *bool `url:"forceStop,omitempty",json:"forceStop,omitempty"` // Make sure the Container stops.
	Timeout   *int  `url:"timeout,omitempty",json:"timeout,omitempty"`     // Wait maximal timeout seconds.
}

type VmShutdownResponse

type VmShutdownResponse string

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    *bool `url:"debug,omitempty",json:"debug,omitempty"`       // If set, enables very verbose debug log-level on start.
	Skiplock *bool `url:"skiplock,omitempty",json:"skiplock,omitempty"` // Ignore locks - only root is allowed to use this option.
}

type VmStartResponse

type VmStartResponse string

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 string                 `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 *bool `url:"skiplock,omitempty",json:"skiplock,omitempty"` // Ignore locks - only root is allowed to use this option.
}

type VmStopResponse

type VmStopResponse string

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.

}

type VmSuspendResponse

type VmSuspendResponse string

Jump to

Keyboard shortcuts

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