content

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

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChildCreateRequest

type ChildCreateRequest struct {
	Node   string `url:"node" json:"node"`     // The cluster node name.
	Target string `url:"target" json:"target"` // Target volume identifier
	Volume string `url:"volume" json:"volume"` // Source volume identifier

	// The following parameters are optional
	Storage    *string `url:"storage,omitempty" json:"storage,omitempty"`         // The storage identifier.
	TargetNode *string `url:"target_node,omitempty" json:"target_node,omitempty"` // Target node. Default is local node.
}

type Client

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

func New

func New(c HTTPClient) *Client

func (*Client) ChildCreate

func (c *Client) ChildCreate(ctx context.Context, req ChildCreateRequest) (string, error)

ChildCreate Copy a volume. This is experimental code - do not use.

func (*Client) Create

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

Create Allocate disk images.

func (*Client) Delete

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

Delete Delete volume

func (*Client) Find

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

Find Get volume attributes

func (*Client) Index

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

Index List storage content.

func (*Client) Update

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

Update Update volume attributes

type CreateRequest

type CreateRequest struct {
	Filename string `url:"filename" json:"filename"` // The name of the file to create.
	Node     string `url:"node" json:"node"`         // The cluster node name.
	Size     string `url:"size" json:"size"`         // Size in kilobyte (1024 bytes). Optional suffixes 'M' (megabyte, 1024K) and 'G' (gigabyte, 1024M)
	Storage  string `url:"storage" json:"storage"`   // The storage identifier.
	Vmid     int    `url:"vmid" json:"vmid"`         // Specify owner VM

	// The following parameters are optional
	Format *Format `url:"format,omitempty" json:"format,omitempty"`
}

type DeleteRequest

type DeleteRequest struct {
	Node   string `url:"node" json:"node"`     // The cluster node name.
	Volume string `url:"volume" json:"volume"` // Volume identifier

	// The following parameters are optional
	Delay   *int    `url:"delay,omitempty" json:"delay,omitempty"`     // Time to wait for the task to finish. We return 'null' if the task finish within that time.
	Storage *string `url:"storage,omitempty" json:"storage,omitempty"` // The storage identifier.
}

type FindRequest

type FindRequest struct {
	Node   string `url:"node" json:"node"`     // The cluster node name.
	Volume string `url:"volume" json:"volume"` // Volume identifier

	// The following parameters are optional
	Storage *string `url:"storage,omitempty" json:"storage,omitempty"` // The storage identifier.
}

type FindResponse

type FindResponse struct {
	Format string `url:"format" json:"format"` // Format identifier ('raw', 'qcow2', 'subvol', 'iso', 'tgz' ...)
	Path   string `url:"path" json:"path"`     // The Path
	Size   int    `url:"size" json:"size"`     // Volume size in bytes.
	Used   int    `url:"used" json:"used"`     // Used space. Please note that most storage plugins do not report anything useful here.

	// The following parameters are optional
	Notes     *string       `url:"notes,omitempty" json:"notes,omitempty"`         // Optional notes.
	Protected *util.PVEBool `url:"protected,omitempty" json:"protected,omitempty"` // Protection status. Currently only supported for backups.
}

type Format added in v0.0.15

type Format string
const (
	Format_RAW    Format = "raw"
	Format_QCOW2  Format = "qcow2"
	Format_SUBVOL Format = "subvol"
)

func PtrFormat added in v0.0.15

func PtrFormat(i Format) *Format

type HTTPClient

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

type IndexRequest

type IndexRequest struct {
	Node    string `url:"node" json:"node"`       // The cluster node name.
	Storage string `url:"storage" json:"storage"` // The storage identifier.

	// The following parameters are optional
	Content *string `url:"content,omitempty" json:"content,omitempty"` // Only list content of this type.
	Vmid    *int    `url:"vmid,omitempty" json:"vmid,omitempty"`       // Only list images for this VM
}

type IndexResponse

type IndexResponse struct {
	Format string `url:"format" json:"format"` // Format identifier ('raw', 'qcow2', 'subvol', 'iso', 'tgz' ...)
	Size   int    `url:"size" json:"size"`     // Volume size in bytes.
	Volid  string `url:"volid" json:"volid"`   // Volume identifier.

	// The following parameters are optional
	Ctime        *int          `url:"ctime,omitempty" json:"ctime,omitempty"`               // Creation time (seconds since the UNIX Epoch).
	Encrypted    *string       `url:"encrypted,omitempty" json:"encrypted,omitempty"`       // If whole backup is encrypted, value is the fingerprint or '1' if encrypted. Only useful for the Proxmox Backup Server storage type.
	Notes        *string       `url:"notes,omitempty" json:"notes,omitempty"`               // Optional notes. If they contain multiple lines, only the first one is returned here.
	Parent       *string       `url:"parent,omitempty" json:"parent,omitempty"`             // Volume identifier of parent (for linked cloned).
	Protected    *util.PVEBool `url:"protected,omitempty" json:"protected,omitempty"`       // Protection status. Currently only supported for backups.
	Used         *int          `url:"used,omitempty" json:"used,omitempty"`                 // Used space. Please note that most storage plugins do not report anything useful here.
	Verification *Verification `url:"verification,omitempty" json:"verification,omitempty"` // Last backup verification result, only useful for PBS storages.
	Vmid         *int          `url:"vmid,omitempty" json:"vmid,omitempty"`                 // Associated Owner VMID.
}

type UpdateRequest

type UpdateRequest struct {
	Node   string `url:"node" json:"node"`     // The cluster node name.
	Volume string `url:"volume" json:"volume"` // Volume identifier

	// The following parameters are optional
	Notes     *string       `url:"notes,omitempty" json:"notes,omitempty"`         // The new notes.
	Protected *util.PVEBool `url:"protected,omitempty" json:"protected,omitempty"` // Protection status. Currently only supported for backups.
	Storage   *string       `url:"storage,omitempty" json:"storage,omitempty"`     // The storage identifier.
}

type Verification added in v0.0.10

type Verification struct {
	State string `url:"state" json:"state"` // Last backup verification state.
	Upid  string `url:"upid" json:"upid"`   // Last backup verification UPID.

}

Last backup verification result, only useful for PBS storages.

Jump to

Keyboard shortcuts

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