info

package
v0.7.6 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: Apache-2.0 Imports: 5 Imported by: 5

Documentation

Overview

Package info implements API functions residing under /info. This path contains methods to query information about created VMs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API interface {
	Get(ctx context.Context, identifier string) (Info, error)
}

API contains methods for VM info querying.

func NewAPI

func NewAPI(c client.Client) API

NewAPI creates a new info API instance with the given client.

type DiskInfo

type DiskInfo struct {
	DiskType     string  `json:"disk_type"`
	StorageType  string  `json:"storage_type"`
	BusType      string  `json:"bus_type"`
	BusTypeLabel string  `json:"bus_type_label"`
	DiskGB       float64 `json:"disk_gb"`
	DiskID       int     `json:"disk_id"`
	IOPS         int     `json:"iops"`
	Latency      int     `json:"latence"`
}

DiskInfo contains meta information of attached disks to a VM.

type Info

type Info struct {
	Name               string     `json:"name"`
	CustomName         string     `json:"custom_name"`
	Identifier         string     `json:"identifier"`
	GuestOS            string     `json:"guest_os"`
	LocationID         string     `json:"location_identifier"`
	LocationCode       string     `json:"location_code"`
	LocationCountry    string     `json:"location_country"`
	LocationName       string     `json:"location_name"`
	TemplateID         string     `json:"template_id"`
	TemplateType       string     `json:"template_type"`
	Status             string     `json:"status"`
	VersionTools       string     `json:"version_tools"`
	GuestToolsStatus   string     `json:"guest_tools_status"`
	RAM                int        `json:"ram"`
	CPU                int        `json:"cpu"`
	CPUClockRate       int        `json:"cpu_clock_rate"`
	CPUPerformanceType string     `json:"cpu_performance_type"`
	Cores              int        `json:"cores"`
	Disks              int        `json:"disks"`
	DiskInfo           []DiskInfo `json:"disk_info"`
	Network            []Network  `json:"network"`
}

Info contains meta information of a VM.

type Network

type Network struct {
	NIC            int      `json:"nic"`
	BandwidthLimit int      `json:"bandwidth_limit"`
	VLAN           string   `json:"vlan"`
	ID             int      `json:"id"`
	IPv4           []string `json:"ips_v4"`
	IPv6           []string `json:"ips_v6"`
	MACAddress     string   `json:"mac_address"`
}

Network contains meta information of attached NICs to a VM.

Jump to

Keyboard shortcuts

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