api

package
v0.0.0-...-1849458 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: MIT Imports: 7 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
}

Client encapsulates communication with the oVirt API

func NewClient

func NewClient(url, user, pass string, insecureCert, debug bool, o ...Option) (*Client, error)

NewClient creates a new API client

func (*Client) CreateSnapshot

func (c *Client) CreateSnapshot(vmID, desc string) (*Snapshot, error)

CreateSnapshot creates a snapshot

func (*Client) DeleteSnapshot

func (c *Client) DeleteSnapshot(vmId, snapShotId string) error

DeleteSnapshot deletes a snapshot

func (*Client) GetCreatedSnapshots

func (c *Client) GetCreatedSnapshots(vmID string) ([]Snapshot, error)

GetCreatedSnapshots returns all snapshots created by oSnap for the specified VM

func (*Client) GetSnapshot

func (c *Client) GetSnapshot(vmID, snapshotid string) (*Snapshot, error)

GetSnapshot returns details for a snapshot

func (*Client) GetVMs

func (c *Client) GetVMs() ([]Vm, error)

GetVMs retrieves the list of VMs

type Cluster

type Cluster struct {
	ID   string `xml:"id,attr"`
	Name string `xml:"name"`
}

type Clusters

type Clusters struct {
	Cluster []Cluster `xml:"cluster"`
}

type Option

type Option func(*Client)

func WithClusterFilter

func WithClusterFilter(filter string) Option

WithClusterFilter sets the cluster filter

func WithExcludes

func WithExcludes(filters []string) Option

WithExcludes sets the exclude filters

func WithIncludes

func WithIncludes(filters []string) Option

WithIncludes sets the include filters

type Snapshot

type Snapshot struct {
	XMLName            xml.Name `xml:"snapshot"`
	ID                 string   `xml:"id,attr,omitempty"`
	Description        string   `xml:"description"`
	PersistMemoryState bool     `xml:"persist_memorystate"`
	Status             string   `xml:"snapshot_status,omitempty"`
	VM                 Vm       `xml:"vm"`
}

type Snapshots

type Snapshots struct {
	Snapshot []Snapshot `xml:"snapshot"`
}

type Vm

type Vm struct {
	ID      string `xml:"id,attr,omitempty"`
	Name    string `xml:"name,omitempty"`
	Cluster struct {
		ID string `xml:"id,attr"`
	} `xml:"cluster,omitempty"`
}

type Vms

type Vms struct {
	VM []Vm `xml:"vm"`
}

Jump to

Keyboard shortcuts

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