pools

package
v0.37.1 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2023 License: MPL-2.0 Imports: 7 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	api.Client
}

Client is an interface for accessing the Proxmox pools API.

func (*Client) CreatePool

func (c *Client) CreatePool(ctx context.Context, d *PoolCreateRequestBody) error

CreatePool creates a pool.

func (*Client) DeletePool

func (c *Client) DeletePool(ctx context.Context, id string) error

DeletePool deletes a pool.

func (*Client) GetPool

func (c *Client) GetPool(ctx context.Context, id string) (*PoolGetResponseData, error)

GetPool retrieves a pool.

func (*Client) ListPools

func (c *Client) ListPools(ctx context.Context) ([]*PoolListResponseData, error)

ListPools retrieves a list of pools.

func (*Client) UpdatePool

func (c *Client) UpdatePool(ctx context.Context, id string, d *PoolUpdateRequestBody) error

UpdatePool updates a pool.

type PoolCreateRequestBody

type PoolCreateRequestBody struct {
	Comment *string `json:"comment,omitempty" url:"comment,omitempty"`
	ID      string  `json:"groupid"           url:"poolid"`
}

PoolCreateRequestBody contains the data for a pool create request.

type PoolGetResponseBody

type PoolGetResponseBody struct {
	Data *PoolGetResponseData `json:"data,omitempty"`
}

PoolGetResponseBody contains the body from a pool get response.

type PoolGetResponseData

type PoolGetResponseData struct {
	Comment *string                                    `json:"comment,omitempty"`
	Members []VirtualEnvironmentPoolGetResponseMembers `json:"members,omitempty"`
}

PoolGetResponseData contains the data from a pool get response.

type PoolListResponseBody

type PoolListResponseBody struct {
	Data []*PoolListResponseData `json:"data,omitempty"`
}

PoolListResponseBody contains the body from a pool list response.

type PoolListResponseData

type PoolListResponseData struct {
	Comment *string `json:"comment,omitempty"`
	ID      string  `json:"poolid"`
}

PoolListResponseData contains the data from a pool list response.

type PoolUpdateRequestBody

type PoolUpdateRequestBody struct {
	// The pool's comment
	Comment *string `json:"comment,omitempty" url:"comment,omitempty"`
	// If this is set to 1, VMs and datastores will be removed from the pool instead of added.
	Delete *types.CustomBool `json:"delete,omitempty" url:"delete,omitempty,int"`
	// The list of virtual machines to add or delete.
	VMs *types.CustomCommaSeparatedList `json:"vms,omitempty" url:"vms,omitempty,comma"`
	// The list of datastores to add or delete.
	Storage *types.CustomCommaSeparatedList `json:"storage,omitempty" url:"storage,omitempty,comma"`
}

PoolUpdateRequestBody contains the data for an pool update request.

type VirtualEnvironmentPoolGetResponseMembers

type VirtualEnvironmentPoolGetResponseMembers struct {
	ID          string  `json:"id"`
	Node        string  `json:"node"`
	DatastoreID *string `json:"storage,omitempty"`
	Type        string  `json:"type"`
	VMID        *int    `json:"vmid"`
}

VirtualEnvironmentPoolGetResponseMembers contains the members data from a pool get response.

Jump to

Keyboard shortcuts

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