cluster

package
v0.46.0 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2024 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) CreateUpdateOptions added in v0.32.0

func (c *Client) CreateUpdateOptions(ctx context.Context, data *OptionsRequestData) error

CreateUpdateOptions updates the cluster options.

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) GetOptions added in v0.32.0

func (c *Client) GetOptions(ctx context.Context) (*OptionsResponseData, error)

GetOptions retrieves the cluster options.

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 OptionsRequestData added in v0.32.0

type OptionsRequestData struct {
	MaxWorkers                *int64  `json:"max_workers,omitempty"     url:"max_workers,omitempty"`
	Delete                    *string `json:"delete,omitempty"          url:"delete,omitempty"`
	ClusterResourceScheduling *string `json:"crs,omitempty"             url:"crs,omitempty"`
	HASettings                *string `json:"ha,omitempty"              url:"ha,omitempty"`
	TagStyle                  *string `json:"tag-style,omitempty"       url:"tag-style,omitempty"`
	Migration                 *string `json:"migration,omitempty"       url:"migration,omitempty"`
	Webauthn                  *string `json:"webauthn,omitempty"        url:"webauthn,omitempty"`
	NextID                    *string `json:"next-id,omitempty"         url:"next-id,omitempty"`
	Notify                    *string `json:"notify,omitempty"          url:"notify,omitempty"`
	UserTagAccess             *string `json:"user-tag-access,omitempty" url:"user-tag-access,omitempty"`
	RegisteredTags            *string `json:"registered-tags,omitempty" url:"registered-tags,omitempty"`
	// contains filtered or unexported fields
}

OptionsRequestData contains the body for cluster options request.

type OptionsResponseBody added in v0.32.0

type OptionsResponseBody struct {
	Data *OptionsResponseData `json:"data,omitempty"`
}

OptionsResponseBody contains the body from a cluster options response.

type OptionsResponseData added in v0.32.0

type OptionsResponseData struct {
	MaxWorkers                *types.CustomInt64 `json:"max_workers,omitempty"`
	ClusterResourceScheduling *crs               `json:"crs,omitempty"`
	HASettings                *haSettings        `json:"ha,omitempty"`
	TagStyle                  *tagStyle          `json:"tag-style,omitempty"`
	Migration                 *migration         `json:"migration,omitempty"`
	Webauthn                  *webauthn          `json:"webauthn,omitempty"`
	NextID                    *nextID            `json:"next-id,omitempty"`
	Notify                    *notify            `json:"notify,omitempty"`
	UserTagAccess             *userTagAccess     `json:"user-tag-access,omitempty"`
	RegisteredTags            *[]string          `json:"registered-tags,omitempty"`
	// contains filtered or unexported fields
}

OptionsResponseData contains the data from a cluster options 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       int64   `json:"disk,omitempty"`
	HaState    string  `json:"hastate,omitempty"`
	Level      string  `json:"level,omitempty"`
	MaxCPU     float64 `json:"maxcpu,omitempty"`
	MaxDisk    int64   `json:"maxdisk,omitempty"`
	MaxMem     int64   `json:"maxmem,omitempty"`
	Mem        int64   `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