Documentation
¶
Index ¶
- Variables
- func ParseURL(u string) (*url.URL, error)
- type Client
- type DataStorage
- type Option
- type Options
- type VDC
- func (vdc *VDC) CoreCount() uint64
- func (vdc *VDC) Memory() DataStorage
- func (vdc *VDC) PoweredOnVMCount() uint64
- func (vdc *VDC) Speed() uint64
- func (vdc *VDC) Storage() DataStorage
- func (vdc *VDC) StorageAll() DataStorage
- func (vdc *VDC) VMCount() uint64
- func (vdc *VDC) VMCountWithQuery(queries ...VMQuerySetter) uint64
- type VDCs
- type VMQuery
- type VMQuerySetter
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 ¶
PoweredOnVMCount retrieves the number of powered-on VMs deployed in the VDC.
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 ¶
func (vdc *VDC) StorageAll() DataStorage
StorageAll retrieves the total amount of used storage for an oVDC, totaling the 'requested' storage for all storage policies.
func (*VDC) VMCountWithQuery ¶
func (vdc *VDC) VMCountWithQuery(queries ...VMQuerySetter) uint64
VMCountWithQuery retrieves the number of VMs matching all of the provided queries. If PoweredOn is false (default), VMs that are both powered on or off will be included.
type VDCs ¶
type VDCs []VDC
VDCs is a slice of vcdusage.VDC wrappers.
func (VDCs) CoreCount ¶
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 ¶
func (vdcs VDCs) Memory() DataStorage
Memory retrieves the amount of used memory to all VDCs, represented as a DataStorage type.
func (VDCs) PoweredOnVMCount ¶
PoweredOnVMCount retrieves the number of powered on VMs deployed in all VDCs.
func (VDCs) Speed ¶
Speed retrieves the max CPU speed of all VDCs in MHz. This is required for calculating core count.
func (VDCs) Storage ¶
func (vdcs VDCs) Storage() DataStorage
Memory retrieves the amount of used storage to all VDCs, represented as a DataStorage type.
func (VDCs) VMCountWithQuery ¶
func (vdcs VDCs) VMCountWithQuery(queries ...VMQuerySetter) uint64
VMCountWithQuery retrieves the number of VMs matching all of the provided queries in all VDCs. If PoweredOn is false (default), VMs that are both powered on or off will be included.
type VMQuerySetter ¶
type VMQuerySetter func(*VMQuery)
func VMPoweredOn ¶
func VMPoweredOn() VMQuerySetter
func VMWithGuestOSContaining ¶
func VMWithGuestOSContaining(contains string) VMQuerySetter
func VMWithGuestOSMatching ¶
func VMWithGuestOSMatching(pattern *regexp.Regexp) VMQuerySetter
func VMWithNameContaining ¶
func VMWithNameContaining(contains string) VMQuerySetter
func VMWithNameMatching ¶
func VMWithNameMatching(pattern *regexp.Regexp) VMQuerySetter
