cluster

package
v0.30.2 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2023 License: MPL-2.0 Imports: 11 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrVMDoesNotExist = errors.New("unable to find VM identifier on any cluster node")

ErrVMDoesNotExist is returned when the VM identifier cannot be found on any cluster node.

Functions

This section is empty.

Types

type Client

type Client struct {
	api.Client
}

Client is an interface for accessing the Proxmox cluster API.

func (*Client) ExpandPath

func (c *Client) ExpandPath(path string) string

ExpandPath expands a relative path to a full cluster API path.

func (*Client) Firewall

func (c *Client) Firewall() clusterfirewall.API

Firewall returns a client for managing the cluster firewall.

func (*Client) GetClusterResources added in v0.23.0

func (c *Client) GetClusterResources(ctx context.Context, resourceType string) ([]*ResourcesListResponseData, error)

GetClusterResources retrieves current resources for cluster.

func (*Client) GetClusterResourcesVM added in v0.23.0

func (c *Client) GetClusterResourcesVM(ctx context.Context) ([]*ResourcesListResponseData, error)

GetClusterResourcesVM retrieves current VM resources for cluster.

func (*Client) GetNextID

func (c *Client) GetNextID(ctx context.Context, vmID *int) (*int, error)

GetNextID retrieves the next free VM identifier for the cluster.

func (*Client) GetVMID added in v0.21.0

func (c *Client) GetVMID(ctx context.Context) (*int, error)

GetVMID retrieves the next available VM identifier.

func (*Client) GetVMNodeName added in v0.23.0

func (c *Client) GetVMNodeName(ctx context.Context, vmID int) (*string, error)

GetVMNodeName gets node for specified vmID.

func (*Client) HA added in v0.30.0

func (c *Client) HA() *ha.Client

HA returns a client for managing the cluster's High Availability features.

type NextIDRequestBody

type NextIDRequestBody struct {
	VMID *int `json:"vmid,omitempty" url:"vmid,omitempty"`
}

NextIDRequestBody contains the data for a cluster next id request.

type NextIDResponseBody

type NextIDResponseBody struct {
	Data *types.CustomInt `json:"data,omitempty"`
}

NextIDResponseBody contains the body from a cluster next id response.

type ResourcesListBody added in v0.23.0

type ResourcesListBody struct {
	Data []*ResourcesListResponseData `json:"data,omitempty"`
}

ResourcesListBody contains the body from a cluste resource list response.

type ResourcesListRequestBody added in v0.23.0

type ResourcesListRequestBody struct {
	Type string `json:"type" url:"type"`
}

ResourcesListRequestBody contains the body params to cluster resource list request.

type ResourcesListResponseData added in v0.23.0

type ResourcesListResponseData struct {
	Type       string  `json:"type"`
	ID         string  `json:"id"`
	CgroupMode int     `json:"cgroup-mode,omitempty"`
	Content    int     `json:"content,omitempty"`
	CPU        float64 `json:"cpu,omitempty"`
	Disk       int     `json:"disk,omitempty"`
	HaState    string  `json:"hastate,omitempty"`
	Level      string  `json:"level,omitempty"`
	MaxCPU     float64 `json:"maxcpu,omitempty"`
	MaxDisk    int     `json:"maxdisk,omitempty"`
	MaxMem     int     `json:"maxmem,omitempty"`
	Mem        int     `json:"mem,omitempty"`
	Name       string  `json:"name,omitempty"`
	NodeName   string  `json:"node,omitempty"`
	PluginType string  `json:"plugintype,omitempty"`
	PoolName   string  `json:"poolname,omitempty"`
	Status     string  `json:"status,omitempty"`
	Storage    string  `json:"storage,omitempty"`
	Uptime     int     `json:"uptime,omitempty"`
	VMID       int     `json:"vmid,omitempty"`
}

ResourcesListResponseData contains the data from a cluster resource list body response.

Directories

Path Synopsis
ha

Jump to

Keyboard shortcuts

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