cluster

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bwlimit added in v0.0.10

type Bwlimit struct {

	// The following parameters are optional
	Clone     *float64 `url:"clone,omitempty" json:"clone,omitempty"`         // bandwidth limit in KiB/s for cloning disks
	Default   *float64 `url:"default,omitempty" json:"default,omitempty"`     // default bandwidth limit in KiB/s
	Migration *float64 `url:"migration,omitempty" json:"migration,omitempty"` // bandwidth limit in KiB/s for migrating guests (including moving local disks)
	Move      *float64 `url:"move,omitempty" json:"move,omitempty"`           // bandwidth limit in KiB/s for moving disks
	Restore   *float64 `url:"restore,omitempty" json:"restore,omitempty"`     // bandwidth limit in KiB/s for restoring guests from backups
}

Set bandwidth/io limits various operations.

func (*Bwlimit) EncodeValues added in v0.0.10

func (t *Bwlimit) EncodeValues(key string, v *url.Values) error

type BwlimitArr added in v0.0.10

type BwlimitArr []Bwlimit

Array of Bwlimit

func (*BwlimitArr) EncodeValues added in v0.0.10

func (t *BwlimitArr) EncodeValues(key string, v *url.Values) error

type Client

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

func New

func New(c HTTPClient) *Client

func (*Client) GetOptions

func (c *Client) GetOptions(ctx context.Context) (map[string]interface{}, error)

GetOptions Get datacenter options. Without 'Sys.Audit' on '/' not all options are returned.

func (*Client) GetStatus

func (c *Client) GetStatus(ctx context.Context) ([]GetStatusResponse, error)

GetStatus Get cluster status information.

func (*Client) Index

func (c *Client) Index(ctx context.Context) ([]map[string]interface{}, error)

Index Cluster index.

func (*Client) Log

func (c *Client) Log(ctx context.Context, req LogRequest) ([]map[string]interface{}, error)

Log Read cluster log

func (*Client) Nextid

func (c *Client) Nextid(ctx context.Context, req NextidRequest) (int, error)

Nextid Get next free VMID. Pass a VMID to assert that its free (at time of check).

func (*Client) Resources

func (c *Client) Resources(ctx context.Context, req ResourcesRequest) ([]ResourcesResponse, error)

Resources Resources index (cluster wide).

func (*Client) SetOptions

func (c *Client) SetOptions(ctx context.Context, req SetOptionsRequest) error

SetOptions Set datacenter options.

func (*Client) Tasks

func (c *Client) Tasks(ctx context.Context) ([]TasksResponse, error)

Tasks List recent tasks (cluster wide).

type Crs added in v0.0.10

type Crs struct {
	Ha string `url:"ha" json:"ha"` // Use this resource scheduler mode for HA.

}

Cluster resource scheduling settings.

func (*Crs) EncodeValues added in v0.0.10

func (t *Crs) EncodeValues(key string, v *url.Values) error

type CrsArr added in v0.0.10

type CrsArr []Crs

Array of Crs

func (*CrsArr) EncodeValues added in v0.0.10

func (t *CrsArr) EncodeValues(key string, v *url.Values) error

type GetStatusResponse

type GetStatusResponse struct {
	Id   string `url:"id" json:"id"`
	Name string `url:"name" json:"name"`
	Type string `url:"type" json:"type"` // Indicates the type, either cluster or node. The type defines the object properties e.g. quorate available for type cluster.

	// The following parameters are optional
	Ip      *string           `url:"ip,omitempty" json:"ip,omitempty"`           // [node] IP of the resolved nodename.
	Level   *string           `url:"level,omitempty" json:"level,omitempty"`     // [node] Proxmox VE Subscription level, indicates if eligible for enterprise support as well as access to the stable Proxmox VE Enterprise Repository.
	Local   *util.SpecialBool `url:"local,omitempty" json:"local,omitempty"`     // [node] Indicates if this is the responding node.
	Nodeid  *int              `url:"nodeid,omitempty" json:"nodeid,omitempty"`   // [node] ID of the node from the corosync configuration.
	Nodes   *int              `url:"nodes,omitempty" json:"nodes,omitempty"`     // [cluster] Nodes count, including offline nodes.
	Online  *util.SpecialBool `url:"online,omitempty" json:"online,omitempty"`   // [node] Indicates if the node is online or offline.
	Quorate *util.SpecialBool `url:"quorate,omitempty" json:"quorate,omitempty"` // [cluster] Indicates if there is a majority of nodes online to make decisions
	Version *int              `url:"version,omitempty" json:"version,omitempty"` // [cluster] Current version of the corosync configuration file.
}

type HTTPClient

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

type Ha added in v0.0.10

type Ha struct {
	ShutdownPolicy string `url:"shutdown_policy" json:"shutdown_policy"` // The policy for HA services on node shutdown. 'freeze' disables auto-recovery, 'failover' ensures recovery, 'conditional' recovers on poweroff and freezes on reboot. 'migrate' will migrate running services to other nodes, if possible. With 'freeze' or 'failover', HA Services will always get stopped first on shutdown.

}

Cluster wide HA settings.

func (*Ha) EncodeValues added in v0.0.10

func (t *Ha) EncodeValues(key string, v *url.Values) error

type HaArr added in v0.0.10

type HaArr []Ha

Array of Ha

func (*HaArr) EncodeValues added in v0.0.10

func (t *HaArr) EncodeValues(key string, v *url.Values) error

type LogRequest

type LogRequest struct {

	// The following parameters are optional
	Max *int `url:"max,omitempty" json:"max,omitempty"` // Maximum number of entries.
}

type Migration added in v0.0.10

type Migration struct {
	Type string `url:"type" json:"type"` // Migration traffic is encrypted using an SSH tunnel by default. On secure, completely private networks this can be disabled to increase performance.

	// The following parameters are optional
	Network *string `url:"network,omitempty" json:"network,omitempty"` // CIDR of the (sub) network that is used for migration.
}

For cluster wide migration settings.

func (*Migration) EncodeValues added in v0.0.10

func (t *Migration) EncodeValues(key string, v *url.Values) error

type MigrationArr added in v0.0.10

type MigrationArr []Migration

Array of Migration

func (*MigrationArr) EncodeValues added in v0.0.10

func (t *MigrationArr) EncodeValues(key string, v *url.Values) error

type NextId added in v0.0.10

type NextId struct {

	// The following parameters are optional
	Lower *int `url:"lower,omitempty" json:"lower,omitempty"` // Lower, inclusive boundary for free next-id API range.
	Upper *int `url:"upper,omitempty" json:"upper,omitempty"` // Upper, exclusive boundary for free next-id API range.
}

Control the range for the free VMID auto-selection pool.

func (*NextId) EncodeValues added in v0.0.10

func (t *NextId) EncodeValues(key string, v *url.Values) error

type NextIdArr added in v0.0.10

type NextIdArr []NextId

Array of NextId

func (*NextIdArr) EncodeValues added in v0.0.10

func (t *NextIdArr) EncodeValues(key string, v *url.Values) error

type NextidRequest

type NextidRequest struct {

	// The following parameters are optional
	Vmid *int `url:"vmid,omitempty" json:"vmid,omitempty"` // The (unique) ID of the VM.
}

type ResourcesRequest

type ResourcesRequest struct {

	// The following parameters are optional
	Type *string `url:"type,omitempty" json:"type,omitempty"`
}

type ResourcesResponse

type ResourcesResponse struct {
	Id   string `url:"id" json:"id"`
	Type string `url:"type" json:"type"` // Resource type.

	// The following parameters are optional
	CgroupMode *int     `url:"cgroup-mode,omitempty" json:"cgroup-mode,omitempty"` // The cgroup mode the node operates under (when type == node).
	Content    *string  `url:"content,omitempty" json:"content,omitempty"`         // Allowed storage content types (when type == storage).
	Cpu        *float64 `url:"cpu,omitempty" json:"cpu,omitempty"`                 // CPU utilization (when type in node,qemu,lxc).
	Disk       *int     `url:"disk,omitempty" json:"disk,omitempty"`               // Used disk space in bytes (when type in storage), used root image spave for VMs (type in qemu,lxc).
	Hastate    *string  `url:"hastate,omitempty" json:"hastate,omitempty"`         // HA service status (for HA managed VMs).
	Level      *string  `url:"level,omitempty" json:"level,omitempty"`             // Support level (when type == node).
	Maxcpu     *float64 `url:"maxcpu,omitempty" json:"maxcpu,omitempty"`           // Number of available CPUs (when type in node,qemu,lxc).
	Maxdisk    *int     `url:"maxdisk,omitempty" json:"maxdisk,omitempty"`         // Storage size in bytes (when type in storage), root image size for VMs (type in qemu,lxc).
	Maxmem     *int     `url:"maxmem,omitempty" json:"maxmem,omitempty"`           // Number of available memory in bytes (when type in node,qemu,lxc).
	Mem        *int     `url:"mem,omitempty" json:"mem,omitempty"`                 // Used memory in bytes (when type in node,qemu,lxc).
	Name       *string  `url:"name,omitempty" json:"name,omitempty"`               // Name of the resource.
	Node       *string  `url:"node,omitempty" json:"node,omitempty"`               // The cluster node name (when type in node,storage,qemu,lxc).
	Plugintype *string  `url:"plugintype,omitempty" json:"plugintype,omitempty"`   // More specific type, if available.
	Pool       *string  `url:"pool,omitempty" json:"pool,omitempty"`               // The pool name (when type in pool,qemu,lxc).
	Status     *string  `url:"status,omitempty" json:"status,omitempty"`           // Resource type dependent status.
	Storage    *string  `url:"storage,omitempty" json:"storage,omitempty"`         // The storage identifier (when type == storage).
	Uptime     *int     `url:"uptime,omitempty" json:"uptime,omitempty"`           // Node uptime in seconds (when type in node,qemu,lxc).
	Vmid       *int     `url:"vmid,omitempty" json:"vmid,omitempty"`               // The numerical vmid (when type in qemu,lxc).
}

type SetOptionsRequest

type SetOptionsRequest struct {

	// The following parameters are optional
	Bwlimit           *Bwlimit          `url:"bwlimit,omitempty" json:"bwlimit,omitempty"`                       // Set bandwidth/io limits various operations.
	Console           *string           `url:"console,omitempty" json:"console,omitempty"`                       // Select the default Console viewer. You can either use the builtin java applet (VNC; deprecated and maps to html5), an external virt-viewer comtatible application (SPICE), an HTML5 based vnc viewer (noVNC), or an HTML5 based console client (xtermjs). If the selected viewer is not available (e.g. SPICE not activated for the VM), the fallback is noVNC.
	Crs               *Crs              `url:"crs,omitempty" json:"crs,omitempty"`                               // Cluster resource scheduling settings.
	Delete            *string           `url:"delete,omitempty" json:"delete,omitempty"`                         // A list of settings you want to delete.
	Description       *string           `url:"description,omitempty" json:"description,omitempty"`               // Datacenter description. Shown in the web-interface datacenter notes panel. This is saved as comment inside the configuration file.
	EmailFrom         *string           `url:"email_from,omitempty" json:"email_from,omitempty"`                 // Specify email address to send notification from (default is root@$hostname)
	Fencing           *string           `url:"fencing,omitempty" json:"fencing,omitempty"`                       // Set the fencing mode of the HA cluster. Hardware mode needs a valid configuration of fence devices in /etc/pve/ha/fence.cfg. With both all two modes are used. WARNING: 'hardware' and 'both' are EXPERIMENTAL & WIP
	Ha                *Ha               `url:"ha,omitempty" json:"ha,omitempty"`                                 // Cluster wide HA settings.
	HttpProxy         *string           `url:"http_proxy,omitempty" json:"http_proxy,omitempty"`                 // Specify external http proxy which is used for downloads (example: 'http://username:password@host:port/')
	Keyboard          *string           `url:"keyboard,omitempty" json:"keyboard,omitempty"`                     // Default keybord layout for vnc server.
	Language          *string           `url:"language,omitempty" json:"language,omitempty"`                     // Default GUI language.
	MacPrefix         *string           `url:"mac_prefix,omitempty" json:"mac_prefix,omitempty"`                 // Prefix for autogenerated MAC addresses.
	MaxWorkers        *int              `url:"max_workers,omitempty" json:"max_workers,omitempty"`               // Defines how many workers (per node) are maximal started on actions like 'stopall VMs' or task from the ha-manager.
	Migration         *Migration        `url:"migration,omitempty" json:"migration,omitempty"`                   // For cluster wide migration settings.
	MigrationUnsecure *util.SpecialBool `url:"migration_unsecure,omitempty" json:"migration_unsecure,omitempty"` // Migration is secure using SSH tunnel by default. For secure private networks you can disable it to speed up migration. Deprecated, use the 'migration' property instead!
	NextId            *NextId           `url:"next-id,omitempty" json:"next-id,omitempty"`                       // Control the range for the free VMID auto-selection pool.
	RegisteredTags    *string           `url:"registered-tags,omitempty" json:"registered-tags,omitempty"`       // A list of tags that require a `Sys.Modify` on '/' to set and delete. Tags set here that are also in 'user-tag-access' also require `Sys.Modify`.
	TagStyle          *TagStyle         `url:"tag-style,omitempty" json:"tag-style,omitempty"`                   // Tag style options.
	U2f               *U2f              `url:"u2f,omitempty" json:"u2f,omitempty"`                               // u2f
	UserTagAccess     *UserTagAccess    `url:"user-tag-access,omitempty" json:"user-tag-access,omitempty"`       // Privilege options for user-settable tags
	Webauthn          *Webauthn         `url:"webauthn,omitempty" json:"webauthn,omitempty"`                     // webauthn configuration
}

type TagStyle added in v0.0.10

type TagStyle struct {

	// The following parameters are optional
	CaseSensitive *util.SpecialBool `url:"case-sensitive,omitempty" json:"case-sensitive,omitempty"` // Controls if filtering for unique tags on update should check case-sensitive.
	ColorMap      *string           `url:"color-map,omitempty" json:"color-map,omitempty"`           // Manual color mapping for tags (semicolon separated).
	Ordering      *string           `url:"ordering,omitempty" json:"ordering,omitempty"`             // Controls the sorting of the tags in the web-interface and the API update.
	Shape         *string           `url:"shape,omitempty" json:"shape,omitempty"`                   // Tag shape for the web ui tree. 'full' draws the full tag. 'circle' draws only a circle with the background color. 'dense' only draws a small rectancle (useful when many tags are assigned to each guest).'none' disables showing the tags.
}

Tag style options.

func (*TagStyle) EncodeValues added in v0.0.10

func (t *TagStyle) EncodeValues(key string, v *url.Values) error

type TagStyleArr added in v0.0.10

type TagStyleArr []TagStyle

Array of TagStyle

func (*TagStyleArr) EncodeValues added in v0.0.10

func (t *TagStyleArr) EncodeValues(key string, v *url.Values) error

type TasksResponse

type TasksResponse struct {
	Upid string `url:"upid" json:"upid"`
}

type U2f added in v0.0.10

type U2f struct {

	// The following parameters are optional
	Appid  *string `url:"appid,omitempty" json:"appid,omitempty"`   // U2F AppId URL override. Defaults to the origin.
	Origin *string `url:"origin,omitempty" json:"origin,omitempty"` // U2F Origin override. Mostly useful for single nodes with a single URL.
}

u2f

func (*U2f) EncodeValues added in v0.0.10

func (t *U2f) EncodeValues(key string, v *url.Values) error

type U2fArr added in v0.0.10

type U2fArr []U2f

Array of U2f

func (*U2fArr) EncodeValues added in v0.0.10

func (t *U2fArr) EncodeValues(key string, v *url.Values) error

type UserTagAccess added in v0.0.10

type UserTagAccess struct {

	// The following parameters are optional
	UserAllow     *string `url:"user-allow,omitempty" json:"user-allow,omitempty"`           // Controls tag usage for users without `Sys.Modify` on `/` by either allowing `none`, a `list`, already `existing` or anything (`free`).
	UserAllowList *string `url:"user-allow-list,omitempty" json:"user-allow-list,omitempty"` // List of tags users are allowed to set and delete (semicolon separated) for 'user-allow' values 'list' and 'existing'.
}

Privilege options for user-settable tags

func (*UserTagAccess) EncodeValues added in v0.0.10

func (t *UserTagAccess) EncodeValues(key string, v *url.Values) error

type UserTagAccessArr added in v0.0.10

type UserTagAccessArr []UserTagAccess

Array of UserTagAccess

func (*UserTagAccessArr) EncodeValues added in v0.0.10

func (t *UserTagAccessArr) EncodeValues(key string, v *url.Values) error

type Webauthn added in v0.0.10

type Webauthn struct {

	// The following parameters are optional
	AllowSubdomains *util.SpecialBool `url:"allow-subdomains,omitempty" json:"allow-subdomains,omitempty"` // Whether to allow the origin to be a subdomain, rather than the exact URL.
	Id              *string           `url:"id,omitempty" json:"id,omitempty"`                             // Relying party ID. Must be the domain name without protocol, port or location. Changing this *will* break existing credentials.
	Origin          *string           `url:"origin,omitempty" json:"origin,omitempty"`                     // Site origin. Must be a `https://` URL (or `http://localhost`). Should contain the address users type in their browsers to access the web interface. Changing this *may* break existing credentials.
	Rp              *string           `url:"rp,omitempty" json:"rp,omitempty"`                             // Relying party name. Any text identifier. Changing this *may* break existing credentials.
}

webauthn configuration

func (*Webauthn) EncodeValues added in v0.0.10

func (t *Webauthn) EncodeValues(key string, v *url.Values) error

type WebauthnArr added in v0.0.10

type WebauthnArr []Webauthn

Array of Webauthn

func (*WebauthnArr) EncodeValues added in v0.0.10

func (t *WebauthnArr) EncodeValues(key string, v *url.Values) error

Jump to

Keyboard shortcuts

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