Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrCfgNoPassword = errors.New("password required")
ErrCfgNoPassword indicates an authentication password was not provided.
var ErrCfgNoURL = errors.New("URL required")
ErrCfgNoURL indicates a URL was not provided.
var ErrCfgNoUsername = errors.New("username required")
ErrCfgNoUsername indicates an authentication username was not provided.
Functions ¶
Types ¶
type Client ¶
type DataStorage ¶
type DataStorage float64
DataStorage is a representation of a data storage amount in bytes.
func (DataStorage) Float64 ¶
func (d DataStorage) Float64() float64
Float64 converts the DataStorage value to float64.
func (DataStorage) GB ¶
func (d DataStorage) GB() float64
GB converts the DataStorage value to GB as float64 with 0 decimal points.
func (DataStorage) Int64 ¶
func (d DataStorage) Int64() int64
Int64 converts the DataStorage value to int64.
func (DataStorage) KB ¶
func (d DataStorage) KB() float64
KB converts the DataStorage value to KB as float64 with 0 decimal points.
func (DataStorage) MB ¶
func (d DataStorage) MB() float64
MB converts the DataStorage value to MB as float64 with 0 decimal points.
func (DataStorage) String ¶
func (d DataStorage) String() string
String converts the DataStorage value to string.
func (DataStorage) TB ¶
func (d DataStorage) TB() float64
TB converts the DataStorage value to TB as float64 with a maximum of 2 decimal points.
func (DataStorage) Uint64 ¶
func (d DataStorage) Uint64() uint64
Uint64 converts the DataStorage value to uint64.
type Option ¶
type Option func(*Options)
func Insecure ¶
func Insecure() Option
Insecure disables SSL certificate validation when communicating with vCloud.
func Org ¶
Org sets the organization name used when authenticating with vCloud. If not set, 'system' will be used.
type VDC ¶
VDC is a wrapper around a govcd.Vdc object with references to the corresponding Admin Org and vcdusage.Client.
func (*VDC) CoreCount ¶
CoreCount retrieves the used CPU MHz for a VDC and calculates the number of cores used by the VDC by dividing the total used CPU MHz by the CPU speed.
For example, if the speed is 3.1 GHz and the used amount is 49.6, the core count is 16.
func (*VDC) Memory ¶
func (vdc *VDC) Memory() DataStorage
Memory retrieves the amount of used memory to an oVDC, represented as a DataStorage type.
func (*VDC) PoweredOnVMCount ¶ added in v0.0.5
PoweredOnVMCount retrieves the number of powered-on
func (*VDC) Speed ¶
Speed retrieves the CPU speed of a VDC in MHz. This is required for calculating core count.
func (*VDC) Storage ¶
func (vdc *VDC) Storage() DataStorage
Storage retrieves the total amount of 'requested' storage for an oVDC using the oVDC default storage policy.
func (*VDC) StorageAll ¶ added in v0.0.6
func (vdc *VDC) StorageAll() DataStorage
StorageAll retrieves the total amount of used storage for an oVDC, totaling the 'requested' storage for all storage policies.
type VDCs ¶ added in v0.0.3
type VDCs []VDC
VDCs is a slice of vcdusage.VDC wrappers.
func (VDCs) CoreCount ¶ added in v0.0.3
CoreCount retrieves the used CPU MHz for a VDC and calculates the number of cores used by all VDCs by dividing the total used CPU MHz by the CPU speed.
For example, if the speed is 3.1 GHz and the used amount is 49.6, the core count is 16.
func (VDCs) Memory ¶ added in v0.0.3
func (vdcs VDCs) Memory() DataStorage
Memory retrieves the amount of used memory to all VDCs, represented as a DataStorage type.
func (VDCs) PoweredOnVMCount ¶ added in v0.0.5
PoweredOnVMCount retrieves the number of powered on VMs deployed in all VDCs.
func (VDCs) Speed ¶ added in v0.0.3
Speed retrieves the max CPU speed of all VDCs in MHz. This is required for calculating core count.
func (VDCs) Storage ¶ added in v0.0.3
func (vdcs VDCs) Storage() DataStorage
Memory retrieves the amount of used storage to all VDCs, represented as a DataStorage type.
