Documentation
¶
Index ¶
- type Client
- func (c *Client) Create(ctx context.Context, req *CreateRequest) (*CreateResponse, error)
- func (c *Client) Delete(ctx context.Context, req *DeleteRequest) (*DeleteResponse, error)
- func (c *Client) Find(ctx context.Context, req *FindRequest) (*FindResponse, error)
- func (c *Client) GetSnapshotConfig(ctx context.Context, req *GetSnapshotConfigRequest) (*GetSnapshotConfigResponse, error)
- func (c *Client) Index(ctx context.Context, req *IndexRequest) (*IndexResponse, error)
- func (c *Client) Rollback(ctx context.Context, req *RollbackRequest) (*RollbackResponse, error)
- func (c *Client) UpdateSnapshotConfig(ctx context.Context, req *UpdateSnapshotConfigRequest) (*UpdateSnapshotConfigResponse, error)
- type CreateRequest
- type CreateResponse
- type DeleteRequest
- type DeleteResponse
- type FindRequest
- type FindResponse
- type GetSnapshotConfigRequest
- type GetSnapshotConfigResponse
- type HTTPClient
- type IndexRequest
- type IndexResponse
- type RollbackRequest
- type RollbackResponse
- type UpdateSnapshotConfigRequest
- type UpdateSnapshotConfigResponse
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 ¶
func (c *Client) UpdateSnapshotConfig(ctx context.Context, req *UpdateSnapshotConfigRequest) (*UpdateSnapshotConfigResponse, 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.SpecialBool `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 *util.SpecialBool `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 FindResponse ¶
type FindResponse []*map[string]interface{}
type GetSnapshotConfigResponse ¶
type GetSnapshotConfigResponse map[string]interface{}
type HTTPClient ¶
type IndexRequest ¶
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.SpecialBool `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.SpecialBool `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{}
Click to show internal directories.
Click to hide internal directories.