pools

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MembersType_QEMU    MembersType = "qemu"
	MembersType_LXC     MembersType = "lxc"
	MembersType_OPENVZ  MembersType = "openvz"
	MembersType_STORAGE MembersType = "storage"

	Type_QEMU    Type = "qemu"
	Type_LXC     Type = "lxc"
	Type_STORAGE Type = "storage"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(c HTTPClient) *Client

func (*Client) Create

func (c *Client) Create(ctx context.Context, req CreateRequest) error

Create Create new pool.

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, req DeleteRequest) error

Delete Delete pool.

func (*Client) Find

func (c *Client) Find(ctx context.Context, req FindRequest) (FindResponse, error)

Find Get pool configuration.

func (*Client) Index

func (c *Client) Index(ctx context.Context) ([]IndexResponse, error)

Index Pool index.

func (*Client) Update

func (c *Client) Update(ctx context.Context, req UpdateRequest) error

Update Update pool data.

type CreateRequest

type CreateRequest struct {
	Poolid string `url:"poolid" json:"poolid"`

	// The following parameters are optional
	Comment *string `url:"comment,omitempty" json:"comment,omitempty"`
}

type DeleteRequest

type DeleteRequest struct {
	Poolid string `url:"poolid" json:"poolid"`
}

type FindRequest

type FindRequest struct {
	Poolid string `url:"poolid" json:"poolid"`

	// The following parameters are optional
	Type *Type `url:"type,omitempty" json:"type,omitempty"`
}

type FindResponse

type FindResponse struct {
	Members []Members `url:"members" json:"members"`

	// The following parameters are optional
	Comment *string `url:"comment,omitempty" json:"comment,omitempty"`
}

type HTTPClient

type HTTPClient interface {
	Do(context.Context, string, string, interface{}, interface{}) error
}

type IndexResponse

type IndexResponse struct {
	Poolid string `url:"poolid" json:"poolid"`
}

type Members added in v0.0.10

type Members struct {
	Id   string      `url:"id" json:"id"`
	Node string      `url:"node" json:"node"`
	Type MembersType `url:"type" json:"type"`

	// The following parameters are optional
	Storage *string `url:"storage,omitempty" json:"storage,omitempty"`
	Vmid    *int    `url:"vmid,omitempty" json:"vmid,omitempty"`
}

type MembersType added in v0.0.15

type MembersType string

func PtrMembersType added in v0.0.15

func PtrMembersType(i MembersType) *MembersType

type Type added in v0.0.15

type Type string

func PtrType added in v0.0.15

func PtrType(i Type) *Type

type UpdateRequest

type UpdateRequest struct {
	Poolid string `url:"poolid" json:"poolid"`

	// The following parameters are optional
	Comment *string       `url:"comment,omitempty" json:"comment,omitempty"`
	Delete  *util.PVEBool `url:"delete,omitempty" json:"delete,omitempty"`   // Remove vms/storage (instead of adding it).
	Storage *string       `url:"storage,omitempty" json:"storage,omitempty"` // List of storage IDs.
	Vms     *string       `url:"vms,omitempty" json:"vms,omitempty"`         // List of virtual machines.
}

Jump to

Keyboard shortcuts

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