Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
//MAPPING is the elastic mapping for a host
MAPPING, _ = elastic.NewMapping(mappingString)
)
Functions ¶
func HostEquals ¶
HostEquals used for testing host equality in tests
Types ¶
type Host ¶
type Host struct { ID string // Unique identifier, default to hostid Name string // A label for the host, eg hostname, role PoolID string // Pool that the Host belongs to IPAddr string // The IP address the host can be reached at from a serviced master RPCPort int // The RPC port of the host Cores int // Number of cores available to serviced Memory uint64 // Amount of RAM (bytes) available to serviced PrivateNetwork string // The private network where containers run, eg 172.16.42.0/24 CreatedAt time.Time UpdatedAt time.Time IPs []HostIPResource // The static IP resources available on the host KernelVersion string KernelRelease string ServiceD struct { Version string Date string Gitcommit string Gitbranch string Giturl string Buildtag string } MonitoringProfile domain.MonitorProfile datastore.VersionedEntity }
Host that runs the control center agent.
func Build ¶
Build creates a Host type from the current host machine, filling out fields using the current machines attributes. The IP param is a routable IP used to connect to to the Host, if empty an IP from the available IPs will be used. The poolid param is the pool the host should belong to. Optional list of IP address strings to set as available IP resources, if not set the IP used for the host will be given as an IP Resource. If any IP is not a valid IP on the machine return error.
func UpdateHostInfo ¶
UpdateHostInfo returns a new host with updated hardware and software info. Does not update poor or IP information
type HostIPResource ¶
type HostIPResource struct { HostID string IPAddress string InterfaceName string MACAddress string }
HostIPResource contains information about a specific IP available as a resource
type HostStore ¶
HostStore type for interacting with Host persistent storage
func (*HostStore) FindHostsWithPoolID ¶
FindHostsWithPoolID returns all hosts with the given poolid.
func (*HostStore) GetHostByIP ¶
GetHostByIP looks up a host by the given ip address