Documentation ¶
Index ¶
- Variables
- type Client
- func (c *Client) CreateUpdateOptions(ctx context.Context, data *OptionsRequestData) error
- func (c *Client) ExpandPath(path string) string
- func (c *Client) Firewall() clusterfirewall.API
- func (c *Client) GetClusterResources(ctx context.Context, resourceType string) ([]*ResourcesListResponseData, error)
- func (c *Client) GetClusterResourcesVM(ctx context.Context) ([]*ResourcesListResponseData, error)
- func (c *Client) GetNextID(ctx context.Context, vmID *int) (*int, error)
- func (c *Client) GetOptions(ctx context.Context) (*OptionsResponseData, error)
- func (c *Client) GetVMID(ctx context.Context) (*int, error)
- func (c *Client) GetVMNodeName(ctx context.Context, vmID int) (*string, error)
- func (c *Client) HA() *ha.Client
- type NextIDRequestBody
- type NextIDResponseBody
- type OptionsRequestData
- type OptionsResponseBody
- type OptionsResponseData
- type ResourcesListBody
- type ResourcesListRequestBody
- type ResourcesListResponseData
Constants ¶
This section is empty.
Variables ¶
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 ¶
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 ¶
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) GetOptions ¶ added in v0.32.0
func (c *Client) GetOptions(ctx context.Context) (*OptionsResponseData, error)
GetOptions retrieves the cluster options.
func (*Client) GetVMNodeName ¶ added in v0.23.0
GetVMNodeName gets node for specified vmID.
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 ¶
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.CustomInt `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.