snapshot

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2023 License: MIT Imports: 1 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) (*CreateResponse, error)

Create Snapshot a VM.

func (*Client) Delete

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

Delete Delete a VM snapshot.

func (*Client) Find

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

Find

func (*Client) GetSnapshotConfig

func (c *Client) GetSnapshotConfig(ctx context.Context, req *GetSnapshotConfigRequest) (*GetSnapshotConfigResponse, 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) (*RollbackResponse, error)

Rollback Rollback VM state to specified snapshot.

func (*Client) UpdateSnapshotConfig

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     *bool   `url:"vmstate,omitempty",json:"vmstate,omitempty"`         // Save the vmstate
}

type CreateResponse

type CreateResponse string

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 *bool `url:"force,omitempty",json:"force,omitempty"` // For removal from config file, even if removing disk snapshots fails.
}

type DeleteResponse

type DeleteResponse string

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 FindResponse

type FindResponse []*map[string]interface{}

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 GetSnapshotConfigResponse

type GetSnapshotConfigResponse map[string]interface{}

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  *bool   `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 *bool `url:"start,omitempty",json:"start,omitempty"` // Whether the VM should get started after rolling back successfully
}

type RollbackResponse

type RollbackResponse string

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.
}

type UpdateSnapshotConfigResponse

type UpdateSnapshotConfigResponse map[string]interface{}

Jump to

Keyboard shortcuts

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