lxc

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 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) CloneVmClone

func (c *Client) CloneVmClone(ctx context.Context, req *CloneVmCloneRequest) (*CloneVmCloneResponse, error)

CloneVmClone Create a container clone/copy

func (*Client) Create

func (c *Client) Create(ctx context.Context, req *CreateRequest) (*CreateResponse, error)

Create Create or restore a container.

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, req *DeleteRequest) (*DeleteResponse, error)

Delete Destroy the container (also delete all uses files).

func (*Client) Find

func (c *Client) Find(ctx context.Context, req *FindRequest) (*FindResponse, error)

Find Directory index

func (*Client) Index

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

Index LXC container index (per node).

func (*Client) MigrateVmMigrate

func (c *Client) MigrateVmMigrate(ctx context.Context, req *MigrateVmMigrateRequest) (*MigrateVmMigrateResponse, error)

MigrateVmMigrate Migrate the container to another node. Creates a new migration task.

func (*Client) MoveVolume

func (c *Client) MoveVolume(ctx context.Context, req *MoveVolumeRequest) (*MoveVolumeResponse, error)

MoveVolume Move a rootfs-/mp-volume to a different storage or to a different container.

func (*Client) Mtunnel

func (c *Client) Mtunnel(ctx context.Context, req *MtunnelRequest) (*MtunnelResponse, error)

Mtunnel Migration tunnel endpoint - only for internal use by CT migration.

func (*Client) Mtunnelwebsocket

func (c *Client) Mtunnelwebsocket(ctx context.Context, req *MtunnelwebsocketRequest) (*MtunnelwebsocketResponse, error)

Mtunnelwebsocket Migration tunnel endpoint for websocket upgrade - only for internal use by VM migration.

func (*Client) RemoteMigrateVmRemoteMigrate

RemoteMigrateVmRemoteMigrate Migrate the container to another cluster. Creates a new migration task. EXPERIMENTAL feature!

func (*Client) ResizeVmResize

func (c *Client) ResizeVmResize(ctx context.Context, req *ResizeVmResizeRequest) (*ResizeVmResizeResponse, error)

ResizeVmResize Resize a container mount point.

func (*Client) Rrd

func (c *Client) Rrd(ctx context.Context, req *RrdRequest) (*RrdResponse, error)

Rrd Read VM RRD statistics (returns PNG)

func (*Client) Rrddata

func (c *Client) Rrddata(ctx context.Context, req *RrddataRequest) (*RrddataResponse, error)

Rrddata Read VM RRD statistics

func (*Client) Spiceproxy

func (c *Client) Spiceproxy(ctx context.Context, req *SpiceproxyRequest) (*SpiceproxyResponse, error)

Spiceproxy Returns a SPICE configuration to connect to the CT.

func (*Client) Template

func (c *Client) Template(ctx context.Context, req *TemplateRequest) (*TemplateResponse, error)

Template Create a Template.

func (*Client) Termproxy

func (c *Client) Termproxy(ctx context.Context, req *TermproxyRequest) (*TermproxyResponse, error)

Termproxy Creates a TCP proxy connection.

func (*Client) UpdateVmConfig

func (c *Client) UpdateVmConfig(ctx context.Context, req *UpdateVmConfigRequest) (*UpdateVmConfigResponse, error)

UpdateVmConfig Set container options.

func (*Client) VmConfig

func (c *Client) VmConfig(ctx context.Context, req *VmConfigRequest) (*VmConfigResponse, error)

VmConfig Get container configuration.

func (*Client) VmFeature

func (c *Client) VmFeature(ctx context.Context, req *VmFeatureRequest) (*VmFeatureResponse, error)

VmFeature Check if feature for virtual machine is available.

func (*Client) VmPending

func (c *Client) VmPending(ctx context.Context, req *VmPendingRequest) (*VmPendingResponse, error)

VmPending Get container configuration, including pending changes.

func (*Client) Vncproxy

func (c *Client) Vncproxy(ctx context.Context, req *VncproxyRequest) (*VncproxyResponse, error)

Vncproxy Creates a TCP VNC proxy connections.

func (*Client) Vncwebsocket

func (c *Client) Vncwebsocket(ctx context.Context, req *VncwebsocketRequest) (*VncwebsocketResponse, error)

Vncwebsocket Opens a weksocket for VNC traffic.

type CloneVmCloneRequest

type CloneVmCloneRequest struct {
	Newid int    `url:"newid",json:"newid"` // VMID for the clone.
	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
	Bwlimit     *float64 `url:"bwlimit,omitempty",json:"bwlimit,omitempty"`         // Override I/O bandwidth limit (in KiB/s).
	Description *string  `url:"description,omitempty",json:"description,omitempty"` // Description for the new CT.
	Full        *bool    `url:"full,omitempty",json:"full,omitempty"`               // Create a full copy of all disks. This is always done when you clone a normal CT. For CT templates, we try to create a linked clone by default.
	Hostname    *string  `url:"hostname,omitempty",json:"hostname,omitempty"`       // Set a hostname for the new CT.
	Pool        *string  `url:"pool,omitempty",json:"pool,omitempty"`               // Add the new CT to the specified pool.
	Snapname    *string  `url:"snapname,omitempty",json:"snapname,omitempty"`       // The name of the snapshot.
	Storage     *string  `url:"storage,omitempty",json:"storage,omitempty"`         // Target storage for full clone.
	Target      *string  `url:"target,omitempty",json:"target,omitempty"`           // Target node. Only allowed if the original VM is on shared storage.
}

type CloneVmCloneResponse

type CloneVmCloneResponse string

type CreateRequest

type CreateRequest struct {
	Node       string `url:"node",json:"node"`             // The cluster node name.
	Ostemplate string `url:"ostemplate",json:"ostemplate"` // The OS template or backup file.
	Vmid       int    `url:"vmid",json:"vmid"`             // The (unique) ID of the VM.

	// The following parameters are optional
	Arch               *string  `url:"arch,omitempty",json:"arch,omitempty"`                                 // OS architecture type.
	Bwlimit            *float64 `url:"bwlimit,omitempty",json:"bwlimit,omitempty"`                           // Override I/O bandwidth limit (in KiB/s).
	Cmode              *string  `url:"cmode,omitempty",json:"cmode,omitempty"`                               // Console mode. By default, the console command tries to open a connection to one of the available tty devices. By setting cmode to 'console' it tries to attach to /dev/console instead. If you set cmode to 'shell', it simply invokes a shell inside the container (no login).
	Console            *bool    `url:"console,omitempty",json:"console,omitempty"`                           // Attach a console device (/dev/console) to the container.
	Cores              *int     `url:"cores,omitempty",json:"cores,omitempty"`                               // The number of cores assigned to the container. A container can use all available cores by default.
	Cpulimit           *float64 `url:"cpulimit,omitempty",json:"cpulimit,omitempty"`                         // Limit of CPU usage.NOTE: If the computer has 2 CPUs, it has a total of '2' CPU time. Value '0' indicates no CPU limit.
	Cpuunits           *int     `url:"cpuunits,omitempty",json:"cpuunits,omitempty"`                         // CPU weight for a container, will be clamped to [1, 10000] in cgroup v2.
	Debug              *bool    `url:"debug,omitempty",json:"debug,omitempty"`                               // Try to be more verbose. For now this only enables debug log-level on start.
	Description        *string  `url:"description,omitempty",json:"description,omitempty"`                   // Description for the Container. Shown in the web-interface CT's summary. This is saved as comment inside the configuration file.
	Features           *string  `url:"features,omitempty",json:"features,omitempty"`                         // Allow containers access to advanced features.
	Force              *bool    `url:"force,omitempty",json:"force,omitempty"`                               // Allow to overwrite existing container.
	Hookscript         *string  `url:"hookscript,omitempty",json:"hookscript,omitempty"`                     // Script that will be exectued during various steps in the containers lifetime.
	Hostname           *string  `url:"hostname,omitempty",json:"hostname,omitempty"`                         // Set a host name for the container.
	IgnoreUnpackErrors *bool    `url:"ignore-unpack-errors,omitempty",json:"ignore-unpack-errors,omitempty"` // Ignore errors when extracting the template.
	Lock               *string  `url:"lock,omitempty",json:"lock,omitempty"`                                 // Lock/unlock the container.
	Memory             *int     `url:"memory,omitempty",json:"memory,omitempty"`                             // Amount of RAM for the container in MB.
	Mpn                *string  `url:"mp[n],omitempty",json:"mp[n],omitempty"`                               // Use volume as container mount point. Use the special syntax STORAGE_ID:SIZE_IN_GiB to allocate a new volume.
	Nameserver         *string  `url:"nameserver,omitempty",json:"nameserver,omitempty"`                     // Sets DNS server IP address for a container. Create will automatically use the setting from the host if you neither set searchdomain nor nameserver.
	Netn               *string  `url:"net[n],omitempty",json:"net[n],omitempty"`                             // Specifies network interfaces for the container.
	Onboot             *bool    `url:"onboot,omitempty",json:"onboot,omitempty"`                             // Specifies whether a container will be started during system bootup.
	Ostype             *string  `url:"ostype,omitempty",json:"ostype,omitempty"`                             // OS type. This is used to setup configuration inside the container, and corresponds to lxc setup scripts in /usr/share/lxc/config/<ostype>.common.conf. Value 'unmanaged' can be used to skip and OS specific setup.
	Password           *string  `url:"password,omitempty",json:"password,omitempty"`                         // Sets root password inside container.
	Pool               *string  `url:"pool,omitempty",json:"pool,omitempty"`                                 // Add the VM to the specified pool.
	Protection         *bool    `url:"protection,omitempty",json:"protection,omitempty"`                     // Sets the protection flag of the container. This will prevent the CT or CT's disk remove/update operation.
	Restore            *bool    `url:"restore,omitempty",json:"restore,omitempty"`                           // Mark this as restore task.
	Rootfs             *string  `url:"rootfs,omitempty",json:"rootfs,omitempty"`                             // Use volume as container root.
	Searchdomain       *string  `url:"searchdomain,omitempty",json:"searchdomain,omitempty"`                 // Sets DNS search domains for a container. Create will automatically use the setting from the host if you neither set searchdomain nor nameserver.
	SshPublicKeys      *string  `url:"ssh-public-keys,omitempty",json:"ssh-public-keys,omitempty"`           // Setup public SSH keys (one key per line, OpenSSH format).
	Start              *bool    `url:"start,omitempty",json:"start,omitempty"`                               // Start the CT after its creation finished successfully.
	Startup            *string  `url:"startup,omitempty",json:"startup,omitempty"`                           // Startup and shutdown behavior. Order is a non-negative number defining the general startup order. Shutdown in done with reverse ordering. Additionally you can set the 'up' or 'down' delay in seconds, which specifies a delay to wait before the next VM is started or stopped.
	Storage            *string  `url:"storage,omitempty",json:"storage,omitempty"`                           // Default Storage.
	Swap               *int     `url:"swap,omitempty",json:"swap,omitempty"`                                 // Amount of SWAP for the container in MB.
	Tags               *string  `url:"tags,omitempty",json:"tags,omitempty"`                                 // Tags of the Container. This is only meta information.
	Template           *bool    `url:"template,omitempty",json:"template,omitempty"`                         // Enable/disable Template.
	Timezone           *string  `url:"timezone,omitempty",json:"timezone,omitempty"`                         // Time zone to use in the container. If option isn't set, then nothing will be done. Can be set to 'host' to match the host time zone, or an arbitrary time zone option from /usr/share/zoneinfo/zone.tab
	Tty                *int     `url:"tty,omitempty",json:"tty,omitempty"`                                   // Specify the number of tty available to the container
	Unique             *bool    `url:"unique,omitempty",json:"unique,omitempty"`                             // Assign a unique random ethernet address.
	Unprivileged       *bool    `url:"unprivileged,omitempty",json:"unprivileged,omitempty"`                 // Makes the container run as unprivileged user. (Should not be modified manually.)
	Unusedn            *string  `url:"unused[n],omitempty",json:"unused[n],omitempty"`                       // Reference to unused volumes. This is used internally, and should not be modified manually.
}

type CreateResponse

type CreateResponse string

type DeleteRequest

type DeleteRequest 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
	DestroyUnreferencedDisks *bool `url:"destroy-unreferenced-disks,omitempty",json:"destroy-unreferenced-disks,omitempty"` // If set, destroy additionally all disks with the VMID from all enabled storages which are not referenced in the config.
	Force                    *bool `url:"force,omitempty",json:"force,omitempty"`                                           // Force destroy, even if running.
	Purge                    *bool `url:"purge,omitempty",json:"purge,omitempty"`                                           // Remove container from all related configurations. For example, backup jobs, replication jobs or HA. Related ACLs and Firewall entries will *always* be removed.
}

type DeleteResponse

type DeleteResponse string

type FindRequest

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

}

type FindResponse

type FindResponse []*struct {
	Subdir string `url:"subdir",json:"subdir"`
}

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.

}

type IndexResponse

type IndexResponse []*struct {
	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 MigrateVmMigrateRequest

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

	// The following parameters are optional
	Bwlimit       *float64 `url:"bwlimit,omitempty",json:"bwlimit,omitempty"`               // Override I/O bandwidth limit (in KiB/s).
	Online        *bool    `url:"online,omitempty",json:"online,omitempty"`                 // Use online/live migration.
	Restart       *bool    `url:"restart,omitempty",json:"restart,omitempty"`               // Use restart migration
	TargetStorage *string  `url:"target-storage,omitempty",json:"target-storage,omitempty"` // Mapping from source to target storages. Providing only a single storage ID maps all source storages to that storage. Providing the special value '1' will map each source storage to itself.
	Timeout       *int     `url:"timeout,omitempty",json:"timeout,omitempty"`               // Timeout in seconds for shutdown for restart migration
}

type MigrateVmMigrateResponse

type MigrateVmMigrateResponse string

type MoveVolumeRequest

type MoveVolumeRequest struct {
	Node   string `url:"node",json:"node"`     // The cluster node name.
	Vmid   int    `url:"vmid",json:"vmid"`     // The (unique) ID of the VM.
	Volume string `url:"volume",json:"volume"` // Volume which will be moved.

	// The following parameters are optional
	Bwlimit      *float64 `url:"bwlimit,omitempty",json:"bwlimit,omitempty"`             // Override I/O bandwidth limit (in KiB/s).
	Delete       *bool    `url:"delete,omitempty",json:"delete,omitempty"`               // Delete the original volume after successful copy. By default the original is kept as an unused volume entry.
	Digest       *string  `url:"digest,omitempty",json:"digest,omitempty"`               // Prevent changes if current configuration file has different SHA1 " .		    "digest. This can be used to prevent concurrent modifications.
	Storage      *string  `url:"storage,omitempty",json:"storage,omitempty"`             // Target Storage.
	TargetDigest *string  `url:"target-digest,omitempty",json:"target-digest,omitempty"` // Prevent changes if current configuration file of the target " .		    "container has a different SHA1 digest. This can be used to prevent " .		    "concurrent modifications.
	TargetVmid   *int     `url:"target-vmid,omitempty",json:"target-vmid,omitempty"`     // The (unique) ID of the VM.
	TargetVolume *string  `url:"target-volume,omitempty",json:"target-volume,omitempty"` // The config key the volume will be moved to. Default is the source volume key.
}

type MoveVolumeResponse

type MoveVolumeResponse string

type MtunnelRequest

type MtunnelRequest 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
	Bridges  *string `url:"bridges,omitempty",json:"bridges,omitempty"`   // List of network bridges to check availability. Will be checked again for actually used bridges during migration.
	Storages *string `url:"storages,omitempty",json:"storages,omitempty"` // List of storages to check permission and availability. Will be checked again for all actually used storages during migration.
}

type MtunnelResponse

type MtunnelResponse struct {
	Socket string `url:"socket",json:"socket"`
	Ticket string `url:"ticket",json:"ticket"`
	Upid   string `url:"upid",json:"upid"`
}

type MtunnelwebsocketRequest

type MtunnelwebsocketRequest struct {
	Node   string `url:"node",json:"node"`     // The cluster node name.
	Socket string `url:"socket",json:"socket"` // unix socket to forward to
	Ticket string `url:"ticket",json:"ticket"` // ticket return by initial 'mtunnel' API call, or retrieved via 'ticket' tunnel command
	Vmid   int    `url:"vmid",json:"vmid"`     // The (unique) ID of the VM.

}

type MtunnelwebsocketResponse

type MtunnelwebsocketResponse struct {

	// The following parameters are optional
	Port   *string `url:"port,omitempty",json:"port,omitempty"`
	Socket *string `url:"socket,omitempty",json:"socket,omitempty"`
}

type RemoteMigrateVmRemoteMigrateRequest

type RemoteMigrateVmRemoteMigrateRequest struct {
	Node           string `url:"node",json:"node"`                       // The cluster node name.
	TargetBridge   string `url:"target-bridge",json:"target-bridge"`     // Mapping from source to target bridges. Providing only a single bridge ID maps all source bridges to that bridge. Providing the special value '1' will map each source bridge to itself.
	TargetEndpoint string `url:"target-endpoint",json:"target-endpoint"` // Remote target endpoint
	TargetStorage  string `url:"target-storage",json:"target-storage"`   // Mapping from source to target storages. Providing only a single storage ID maps all source storages to that storage. Providing the special value '1' will map each source storage to itself.
	Vmid           int    `url:"vmid",json:"vmid"`                       // The (unique) ID of the VM.

	// The following parameters are optional
	Bwlimit    *float64 `url:"bwlimit,omitempty",json:"bwlimit,omitempty"`         // Override I/O bandwidth limit (in KiB/s).
	Delete     *bool    `url:"delete,omitempty",json:"delete,omitempty"`           // Delete the original CT and related data after successful migration. By default the original CT is kept on the source cluster in a stopped state.
	Online     *bool    `url:"online,omitempty",json:"online,omitempty"`           // Use online/live migration.
	Restart    *bool    `url:"restart,omitempty",json:"restart,omitempty"`         // Use restart migration
	TargetVmid *int     `url:"target-vmid,omitempty",json:"target-vmid,omitempty"` // The (unique) ID of the VM.
	Timeout    *int     `url:"timeout,omitempty",json:"timeout,omitempty"`         // Timeout in seconds for shutdown for restart migration
}

type RemoteMigrateVmRemoteMigrateResponse

type RemoteMigrateVmRemoteMigrateResponse string

type ResizeVmResizeRequest

type ResizeVmResizeRequest struct {
	Disk string `url:"disk",json:"disk"` // The disk you want to resize.
	Node string `url:"node",json:"node"` // The cluster node name.
	Size string `url:"size",json:"size"` // The new size. With the '+' sign the value is added to the actual size of the volume and without it, the value is taken as an absolute one. Shrinking disk size is not supported.
	Vmid int    `url:"vmid",json:"vmid"` // The (unique) ID of the VM.

	// The following parameters are optional
	Digest *string `url:"digest,omitempty",json:"digest,omitempty"` // Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications.
}

type ResizeVmResizeResponse

type ResizeVmResizeResponse string

type RrdRequest

type RrdRequest struct {
	Ds        string `url:"ds",json:"ds"`               // The list of datasources you want to display.
	Node      string `url:"node",json:"node"`           // The cluster node name.
	Timeframe string `url:"timeframe",json:"timeframe"` // Specify the time frame you are interested in.
	Vmid      int    `url:"vmid",json:"vmid"`           // The (unique) ID of the VM.

	// The following parameters are optional
	Cf *string `url:"cf,omitempty",json:"cf,omitempty"` // The RRD consolidation function
}

type RrdResponse

type RrdResponse struct {
	Filename string `url:"filename",json:"filename"`
}

type RrddataRequest

type RrddataRequest struct {
	Node      string `url:"node",json:"node"`           // The cluster node name.
	Timeframe string `url:"timeframe",json:"timeframe"` // Specify the time frame you are interested in.
	Vmid      int    `url:"vmid",json:"vmid"`           // The (unique) ID of the VM.

	// The following parameters are optional
	Cf *string `url:"cf,omitempty",json:"cf,omitempty"` // The RRD consolidation function
}

type RrddataResponse

type RrddataResponse []*map[string]interface{}

type SpiceproxyRequest

type SpiceproxyRequest 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
	Proxy *string `url:"proxy,omitempty",json:"proxy,omitempty"` // SPICE proxy server. This can be used by the client to specify the proxy server. All nodes in a cluster runs 'spiceproxy', so it is up to the client to choose one. By default, we return the node where the VM is currently running. As reasonable setting is to use same node you use to connect to the API (This is window.location.hostname for the JS GUI).
}

type SpiceproxyResponse

type SpiceproxyResponse struct {
	Host     string `url:"host",json:"host"`
	Password string `url:"password",json:"password"`
	Proxy    string `url:"proxy",json:"proxy"`
	TlsPort  int    `url:"tls-port",json:"tls-port"`
	Type     string `url:"type",json:"type"`
}

type TemplateRequest

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

}

type TemplateResponse

type TemplateResponse map[string]interface{}

type TermproxyRequest

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

}

type TermproxyResponse

type TermproxyResponse struct {
	Port   int    `url:"port",json:"port"`
	Ticket string `url:"ticket",json:"ticket"`
	Upid   string `url:"upid",json:"upid"`
	User   string `url:"user",json:"user"`
}

type UpdateVmConfigRequest

type UpdateVmConfigRequest 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
	Arch         *string  `url:"arch,omitempty",json:"arch,omitempty"`                 // OS architecture type.
	Cmode        *string  `url:"cmode,omitempty",json:"cmode,omitempty"`               // Console mode. By default, the console command tries to open a connection to one of the available tty devices. By setting cmode to 'console' it tries to attach to /dev/console instead. If you set cmode to 'shell', it simply invokes a shell inside the container (no login).
	Console      *bool    `url:"console,omitempty",json:"console,omitempty"`           // Attach a console device (/dev/console) to the container.
	Cores        *int     `url:"cores,omitempty",json:"cores,omitempty"`               // The number of cores assigned to the container. A container can use all available cores by default.
	Cpulimit     *float64 `url:"cpulimit,omitempty",json:"cpulimit,omitempty"`         // Limit of CPU usage.NOTE: If the computer has 2 CPUs, it has a total of '2' CPU time. Value '0' indicates no CPU limit.
	Cpuunits     *int     `url:"cpuunits,omitempty",json:"cpuunits,omitempty"`         // CPU weight for a container, will be clamped to [1, 10000] in cgroup v2.
	Debug        *bool    `url:"debug,omitempty",json:"debug,omitempty"`               // Try to be more verbose. For now this only enables debug log-level on start.
	Delete       *string  `url:"delete,omitempty",json:"delete,omitempty"`             // A list of settings you want to delete.
	Description  *string  `url:"description,omitempty",json:"description,omitempty"`   // Description for the Container. Shown in the web-interface CT's summary. This is saved as comment inside the configuration file.
	Digest       *string  `url:"digest,omitempty",json:"digest,omitempty"`             // Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications.
	Features     *string  `url:"features,omitempty",json:"features,omitempty"`         // Allow containers access to advanced features.
	Hookscript   *string  `url:"hookscript,omitempty",json:"hookscript,omitempty"`     // Script that will be exectued during various steps in the containers lifetime.
	Hostname     *string  `url:"hostname,omitempty",json:"hostname,omitempty"`         // Set a host name for the container.
	Lock         *string  `url:"lock,omitempty",json:"lock,omitempty"`                 // Lock/unlock the container.
	Memory       *int     `url:"memory,omitempty",json:"memory,omitempty"`             // Amount of RAM for the container in MB.
	Mpn          *string  `url:"mp[n],omitempty",json:"mp[n],omitempty"`               // Use volume as container mount point. Use the special syntax STORAGE_ID:SIZE_IN_GiB to allocate a new volume.
	Nameserver   *string  `url:"nameserver,omitempty",json:"nameserver,omitempty"`     // Sets DNS server IP address for a container. Create will automatically use the setting from the host if you neither set searchdomain nor nameserver.
	Netn         *string  `url:"net[n],omitempty",json:"net[n],omitempty"`             // Specifies network interfaces for the container.
	Onboot       *bool    `url:"onboot,omitempty",json:"onboot,omitempty"`             // Specifies whether a container will be started during system bootup.
	Ostype       *string  `url:"ostype,omitempty",json:"ostype,omitempty"`             // OS type. This is used to setup configuration inside the container, and corresponds to lxc setup scripts in /usr/share/lxc/config/<ostype>.common.conf. Value 'unmanaged' can be used to skip and OS specific setup.
	Protection   *bool    `url:"protection,omitempty",json:"protection,omitempty"`     // Sets the protection flag of the container. This will prevent the CT or CT's disk remove/update operation.
	Revert       *string  `url:"revert,omitempty",json:"revert,omitempty"`             // Revert a pending change.
	Rootfs       *string  `url:"rootfs,omitempty",json:"rootfs,omitempty"`             // Use volume as container root.
	Searchdomain *string  `url:"searchdomain,omitempty",json:"searchdomain,omitempty"` // Sets DNS search domains for a container. Create will automatically use the setting from the host if you neither set searchdomain nor nameserver.
	Startup      *string  `url:"startup,omitempty",json:"startup,omitempty"`           // Startup and shutdown behavior. Order is a non-negative number defining the general startup order. Shutdown in done with reverse ordering. Additionally you can set the 'up' or 'down' delay in seconds, which specifies a delay to wait before the next VM is started or stopped.
	Swap         *int     `url:"swap,omitempty",json:"swap,omitempty"`                 // Amount of SWAP for the container in MB.
	Tags         *string  `url:"tags,omitempty",json:"tags,omitempty"`                 // Tags of the Container. This is only meta information.
	Template     *bool    `url:"template,omitempty",json:"template,omitempty"`         // Enable/disable Template.
	Timezone     *string  `url:"timezone,omitempty",json:"timezone,omitempty"`         // Time zone to use in the container. If option isn't set, then nothing will be done. Can be set to 'host' to match the host time zone, or an arbitrary time zone option from /usr/share/zoneinfo/zone.tab
	Tty          *int     `url:"tty,omitempty",json:"tty,omitempty"`                   // Specify the number of tty available to the container
	Unprivileged *bool    `url:"unprivileged,omitempty",json:"unprivileged,omitempty"` // Makes the container run as unprivileged user. (Should not be modified manually.)
	Unusedn      *string  `url:"unused[n],omitempty",json:"unused[n],omitempty"`       // Reference to unused volumes. This is used internally, and should not be modified manually.
}

type UpdateVmConfigResponse

type UpdateVmConfigResponse map[string]interface{}

type VmConfigRequest

type VmConfigRequest 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
	Current  *bool   `url:"current,omitempty",json:"current,omitempty"`   // Get current values (instead of pending values).
	Snapshot *string `url:"snapshot,omitempty",json:"snapshot,omitempty"` // Fetch config values from given snapshot.
}

type VmConfigResponse

type VmConfigResponse struct {
	Digest string `url:"digest",json:"digest"` // SHA1 digest of configuration file. This can be used to prevent concurrent modifications.

	// The following parameters are optional
	Arch         *string    `url:"arch,omitempty",json:"arch,omitempty"`                 // OS architecture type.
	Cmode        *string    `url:"cmode,omitempty",json:"cmode,omitempty"`               // Console mode. By default, the console command tries to open a connection to one of the available tty devices. By setting cmode to 'console' it tries to attach to /dev/console instead. If you set cmode to 'shell', it simply invokes a shell inside the container (no login).
	Console      *bool      `url:"console,omitempty",json:"console,omitempty"`           // Attach a console device (/dev/console) to the container.
	Cores        *int       `url:"cores,omitempty",json:"cores,omitempty"`               // The number of cores assigned to the container. A container can use all available cores by default.
	Cpulimit     *float64   `url:"cpulimit,omitempty",json:"cpulimit,omitempty"`         // Limit of CPU usage.NOTE: If the computer has 2 CPUs, it has a total of '2' CPU time. Value '0' indicates no CPU limit.
	Cpuunits     *int       `url:"cpuunits,omitempty",json:"cpuunits,omitempty"`         // CPU weight for a container, will be clamped to [1, 10000] in cgroup v2.
	Debug        *bool      `url:"debug,omitempty",json:"debug,omitempty"`               // Try to be more verbose. For now this only enables debug log-level on start.
	Description  *string    `url:"description,omitempty",json:"description,omitempty"`   // Description for the Container. Shown in the web-interface CT's summary. This is saved as comment inside the configuration file.
	Features     *string    `url:"features,omitempty",json:"features,omitempty"`         // Allow containers access to advanced features.
	Hookscript   *string    `url:"hookscript,omitempty",json:"hookscript,omitempty"`     // Script that will be exectued during various steps in the containers lifetime.
	Hostname     *string    `url:"hostname,omitempty",json:"hostname,omitempty"`         // Set a host name for the container.
	Lock         *string    `url:"lock,omitempty",json:"lock,omitempty"`                 // Lock/unlock the container.
	Lxc          [][]string `url:"lxc,omitempty",json:"lxc,omitempty"`                   // Array of lxc low-level configurations ([[key1, value1], [key2, value2] ...]).
	Memory       *int       `url:"memory,omitempty",json:"memory,omitempty"`             // Amount of RAM for the container in MB.
	Mpn          *string    `url:"mp[n],omitempty",json:"mp[n],omitempty"`               // Use volume as container mount point. Use the special syntax STORAGE_ID:SIZE_IN_GiB to allocate a new volume.
	Nameserver   *string    `url:"nameserver,omitempty",json:"nameserver,omitempty"`     // Sets DNS server IP address for a container. Create will automatically use the setting from the host if you neither set searchdomain nor nameserver.
	Netn         *string    `url:"net[n],omitempty",json:"net[n],omitempty"`             // Specifies network interfaces for the container.
	Onboot       *bool      `url:"onboot,omitempty",json:"onboot,omitempty"`             // Specifies whether a container will be started during system bootup.
	Ostype       *string    `url:"ostype,omitempty",json:"ostype,omitempty"`             // OS type. This is used to setup configuration inside the container, and corresponds to lxc setup scripts in /usr/share/lxc/config/<ostype>.common.conf. Value 'unmanaged' can be used to skip and OS specific setup.
	Protection   *bool      `url:"protection,omitempty",json:"protection,omitempty"`     // Sets the protection flag of the container. This will prevent the CT or CT's disk remove/update operation.
	Rootfs       *string    `url:"rootfs,omitempty",json:"rootfs,omitempty"`             // Use volume as container root.
	Searchdomain *string    `url:"searchdomain,omitempty",json:"searchdomain,omitempty"` // Sets DNS search domains for a container. Create will automatically use the setting from the host if you neither set searchdomain nor nameserver.
	Startup      *string    `url:"startup,omitempty",json:"startup,omitempty"`           // Startup and shutdown behavior. Order is a non-negative number defining the general startup order. Shutdown in done with reverse ordering. Additionally you can set the 'up' or 'down' delay in seconds, which specifies a delay to wait before the next VM is started or stopped.
	Swap         *int       `url:"swap,omitempty",json:"swap,omitempty"`                 // Amount of SWAP for the container in MB.
	Tags         *string    `url:"tags,omitempty",json:"tags,omitempty"`                 // Tags of the Container. This is only meta information.
	Template     *bool      `url:"template,omitempty",json:"template,omitempty"`         // Enable/disable Template.
	Timezone     *string    `url:"timezone,omitempty",json:"timezone,omitempty"`         // Time zone to use in the container. If option isn't set, then nothing will be done. Can be set to 'host' to match the host time zone, or an arbitrary time zone option from /usr/share/zoneinfo/zone.tab
	Tty          *int       `url:"tty,omitempty",json:"tty,omitempty"`                   // Specify the number of tty available to the container
	Unprivileged *bool      `url:"unprivileged,omitempty",json:"unprivileged,omitempty"` // Makes the container run as unprivileged user. (Should not be modified manually.)
	Unusedn      *string    `url:"unused[n],omitempty",json:"unused[n],omitempty"`       // Reference to unused volumes. This is used internally, and should not be modified manually.
}

type VmFeatureRequest

type VmFeatureRequest struct {
	Feature string `url:"feature",json:"feature"` // Feature to check.
	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
	Snapname *string `url:"snapname,omitempty",json:"snapname,omitempty"` // The name of the snapshot.
}

type VmFeatureResponse

type VmFeatureResponse struct {
	Hasfeature bool `url:"hasFeature",json:"hasFeature"`
}

type VmPendingRequest

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

}

type VmPendingResponse

type VmPendingResponse []*struct {
	Key string `url:"key",json:"key"` // Configuration option name.

	// The following parameters are optional
	Delete  *int    `url:"delete,omitempty",json:"delete,omitempty"`   // Indicates a pending delete request if present and not 0.
	Pending *string `url:"pending,omitempty",json:"pending,omitempty"` // Pending value.
	Value   *string `url:"value,omitempty",json:"value,omitempty"`     // Current value.
}

type VncproxyRequest

type VncproxyRequest 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
	Height    *int  `url:"height,omitempty",json:"height,omitempty"`       // sets the height of the console in pixels.
	Websocket *bool `url:"websocket,omitempty",json:"websocket,omitempty"` // use websocket instead of standard VNC.
	Width     *int  `url:"width,omitempty",json:"width,omitempty"`         // sets the width of the console in pixels.
}

type VncproxyResponse

type VncproxyResponse struct {
	Cert   string `url:"cert",json:"cert"`
	Port   int    `url:"port",json:"port"`
	Ticket string `url:"ticket",json:"ticket"`
	Upid   string `url:"upid",json:"upid"`
	User   string `url:"user",json:"user"`
}

type VncwebsocketRequest

type VncwebsocketRequest struct {
	Node      string `url:"node",json:"node"`           // The cluster node name.
	Port      int    `url:"port",json:"port"`           // Port number returned by previous vncproxy call.
	Vmid      int    `url:"vmid",json:"vmid"`           // The (unique) ID of the VM.
	Vncticket string `url:"vncticket",json:"vncticket"` // Ticket from previous call to vncproxy.

}

type VncwebsocketResponse

type VncwebsocketResponse struct {
	Port string `url:"port",json:"port"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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