client

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AnkaNameAlreadyExistsErrorCode   = 18
	AnkaVMNotFoundExceptionErrorCode = 3
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
}

func (*Client) Clone

func (c *Client) Clone(params CloneParams) error

func (*Client) Copy added in v1.7.0

func (c *Client) Copy(params CopyParams) error

func (*Client) Create

func (c *Client) Create(params CreateParams, outputStreamer chan string) (CreateResponse, error)

func (*Client) Delete

func (c *Client) Delete(params DeleteParams) error

func (*Client) Describe

func (c *Client) Describe(vmName string) (DescribeResponse, error)

func (*Client) Exists

func (c *Client) Exists(vmName string) (bool, error)

func (*Client) License added in v1.8.0

func (c *Client) License() (LicenseResponse, error)

func (*Client) Modify added in v1.1.0

func (c *Client) Modify(vmName string, command string, property string, flags ...string) error

func (*Client) Run

func (c *Client) Run(params RunParams) (error, int)

func (*Client) Show

func (c *Client) Show(vmName string) (ShowResponse, error)

func (*Client) Start

func (c *Client) Start(params StartParams) error

func (*Client) Stop

func (c *Client) Stop(params StopParams) error

func (*Client) Suspend

func (c *Client) Suspend(params SuspendParams) error

func (*Client) Version

func (c *Client) Version() (VersionResponse, error)

type CloneParams

type CloneParams struct {
	VMName     string
	SourceUUID string
}

type CopyParams added in v1.7.0

type CopyParams struct {
	Src string
	Dst string
}

type CreateParams

type CreateParams struct {
	Name         string
	InstallerApp string
	OpticalDrive string
	RAMSize      string
	DiskSize     string
	CPUCount     string
}

type CreateResponse

type CreateResponse struct {
	UUID     string `json:"uuid"`
	Name     string `json:"name"`
	CPUCores int    `json:"cpu_cores"`
	RAM      string `json:"ram"`
	ImageID  string `json:"image_id"`
	Status   string `json:"status"`
}

type DeleteParams

type DeleteParams struct {
	VMName string
}

type DescribeResponse

type DescribeResponse struct {
	Name    string `json:"name"`
	Version int    `json:"version"`
	UUID    string `json:"uuid"`
	CPU     struct {
		Cores   int `json:"cores"`
		Threads int `json:"threads"`
	} `json:"cpu"`
	RAM string `json:"ram"`
	Usb struct {
		Tablet   int         `json:"tablet"`
		Kbd      int         `json:"kbd"`
		Host     interface{} `json:"host"`
		Location interface{} `json:"location"`
		PciSlot  int         `json:"pci_slot"`
		Mouse    int         `json:"mouse"`
	} `json:"usb"`
	OpticalDrives []interface{} `json:"optical_drives"`
	HardDrives    []struct {
		Controller string `json:"controller"`
		PciSlot    int    `json:"pci_slot"`
		File       string `json:"file"`
	} `json:"hard_drives"`
	NetworkCards []struct {
		Index               int    `json:"index"`
		Mode                string `json:"mode"`
		MacAddress          string `json:"mac_address"`
		PortForwardingRules []struct {
			GuestPort int    `json:"guest_port"`
			RuleName  string `json:"rule_name"`
			Protocol  string `json:"protocol"`
			HostIP    string `json:"host_ip"`
			HostPort  int    `json:"host_port"`
		} `json:"port_forwarding_rules"`
		PciSlot int    `json:"pci_slot"`
		Type    string `json:"type"`
	} `json:"network_cards"`
	Smbios struct {
		Type string `json:"type"`
	} `json:"smbios"`
	Smc struct {
		Type string `json:"type"`
	} `json:"smc"`
	Nvram    bool `json:"nvram"`
	Firmware struct {
		Type string `json:"type"`
	} `json:"firmware"`
	Display struct {
		Headless    int `json:"headless"`
		FrameBuffer struct {
			PciSlot  int    `json:"pci_slot"`
			VncPort  int    `json:"vnc_port"`
			Height   int    `json:"height"`
			Width    int    `json:"width"`
			VncIP    string `json:"vnc_ip"`
			Password string `json:"password"`
		} `json:"frame_buffer"`
	} `json:"display"`
}

type LicenseResponse added in v1.8.0

type LicenseResponse struct {
	LicenseType string `json:"license_type"`
	Status      string `json:"status"`
}

type RunParams

type RunParams struct {
	VMName         string
	Volume         string
	Command        []string
	Stdin          io.Reader
	Stdout, Stderr io.Writer
	Debug          bool
	User           string
}

type Runner

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

func NewRunner

func NewRunner(params RunParams) *Runner

func (*Runner) Start

func (r *Runner) Start() error

func (*Runner) Wait

func (r *Runner) Wait() (error, int)

type ShowResponse

type ShowResponse struct {
	UUID      string `json:"uuid"`
	Name      string `json:"name"`
	CPUCores  int    `json:"cpu_cores"`
	RAM       string `json:"ram"`
	ImageID   string `json:"image_id"`
	Status    string `json:"status"`
	HardDrive uint64 `json:"hard_drive"`
}

func (ShowResponse) IsRunning

func (sr ShowResponse) IsRunning() bool

func (ShowResponse) IsStopped added in v1.1.0

func (sr ShowResponse) IsStopped() bool

type StartParams

type StartParams struct {
	VMName       string
	UpdateAddons bool
}

type StopParams

type StopParams struct {
	VMName string
	Force  bool
}

type SuspendParams

type SuspendParams struct {
	VMName string
}

type VersionResponse added in v1.7.0

type VersionResponse struct {
	Status string              `json:"status"`
	Body   VersionResponseBody `json:"body"`
}

type VersionResponseBody added in v1.7.0

type VersionResponseBody struct {
	Product string `json:"product"`
	Version string `json:"version"`
	Build   string `json:"build"`
}

Jump to

Keyboard shortcuts

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