Documentation ¶
Index ¶
- Variables
- type Client
- 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) GetVMID(ctx context.Context) (*int, error)
- func (c *Client) GetVMNodeName(ctx context.Context, vmID int) (*string, error)
- type NextIDRequestBody
- type NextIDResponseBody
- 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) 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.
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 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.