snapshot

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 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) (string, error)

Create Snapshot a VM.

func (*Client) Delete

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

Delete Delete a VM snapshot.

func (*Client) Find

func (c *Client) Find(ctx context.Context, req FindRequest) ([]map[string]interface{}, error)

Find

func (*Client) GetSnapshotConfig

func (c *Client) GetSnapshotConfig(ctx context.Context, req GetSnapshotConfigRequest) (map[string]interface{}, error)

GetSnapshotConfig Get snapshot configuration

func (*Client) Index

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

Index List all snapshots.

func (*Client) Rollback

func (c *Client) Rollback(ctx context.Context, req RollbackRequest) (string, error)

Rollback Rollback VM state to specified snapshot.

func (*Client) UpdateSnapshotConfig

func (c *Client) UpdateSnapshotConfig(ctx context.Context, req UpdateSnapshotConfigRequest) error

UpdateSnapshotConfig Update snapshot metadata.

type CreateRequest

type CreateRequest struct {
	Node     string `url:"node" json:"node"`         // The cluster node name.
	Snapname string `url:"snapname" json:"snapname"` // The name of the snapshot.
	Vmid     int    `url:"vmid" json:"vmid"`         // The (unique) ID of the VM.

	// The following parameters are optional
	Description *string       `url:"description,omitempty" json:"description,omitempty"` // A textual description or comment.
	Vmstate     *util.PVEBool `url:"vmstate,omitempty" json:"vmstate,omitempty"`         // Save the vmstate
}

type DeleteRequest

type DeleteRequest struct {
	Node     string `url:"node" json:"node"`         // The cluster node name.
	Snapname string `url:"snapname" json:"snapname"` // The name of the snapshot.
	Vmid     int    `url:"vmid" json:"vmid"`         // The (unique) ID of the VM.

	// The following parameters are optional
	Force *util.PVEBool `url:"force,omitempty" json:"force,omitempty"` // For removal from config file, even if removing disk snapshots fails.
}

type FindRequest

type FindRequest struct {
	Node     string `url:"node" json:"node"`         // The cluster node name.
	Snapname string `url:"snapname" json:"snapname"` // The name of the snapshot.
	Vmid     int    `url:"vmid" json:"vmid"`         // The (unique) ID of the VM.

}

type GetSnapshotConfigRequest

type GetSnapshotConfigRequest struct {
	Node     string `url:"node" json:"node"`         // The cluster node name.
	Snapname string `url:"snapname" json:"snapname"` // The name of the snapshot.
	Vmid     int    `url:"vmid" json:"vmid"`         // The (unique) ID of the VM.

}

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.
	Vmid int    `url:"vmid" json:"vmid"` // The (unique) ID of the VM.

}

type IndexResponse

type IndexResponse struct {
	Description string `url:"description" json:"description"` // Snapshot description.
	Name        string `url:"name" json:"name"`               // Snapshot identifier. Value 'current' identifies the current VM.

	// The following parameters are optional
	Parent   *string       `url:"parent,omitempty" json:"parent,omitempty"`     // Parent snapshot identifier.
	Snaptime *int          `url:"snaptime,omitempty" json:"snaptime,omitempty"` // Snapshot creation time
	Vmstate  *util.PVEBool `url:"vmstate,omitempty" json:"vmstate,omitempty"`   // Snapshot includes RAM.
}

type RollbackRequest

type RollbackRequest struct {
	Node     string `url:"node" json:"node"`         // The cluster node name.
	Snapname string `url:"snapname" json:"snapname"` // The name of the snapshot.
	Vmid     int    `url:"vmid" json:"vmid"`         // The (unique) ID of the VM.

	// The following parameters are optional
	Start *util.PVEBool `url:"start,omitempty" json:"start,omitempty"` // Whether the VM should get started after rolling back successfully. (Note: VMs will be automatically started if the snapshot includes RAM.)
}

type UpdateSnapshotConfigRequest

type UpdateSnapshotConfigRequest struct {
	Node     string `url:"node" json:"node"`         // The cluster node name.
	Snapname string `url:"snapname" json:"snapname"` // The name of the snapshot.
	Vmid     int    `url:"vmid" json:"vmid"`         // The (unique) ID of the VM.

	// The following parameters are optional
	Description *string `url:"description,omitempty" json:"description,omitempty"` // A textual description or comment.
}

Jump to

Keyboard shortcuts

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