Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrSizeTooBig = errors.New("calculated memory exceeds base value")
var (
//MAPPING is the elastic mapping for a host
MAPPING, _ = elastic.NewMapping(mappingString)
)
Functions ¶
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 CoresCommitment int // Number of CPU shares (cores) allocated by the user RAMCommitment uint64 // DEPRECATED: Amount of RAM (bytes) allocated by the user RAMLimit string // Amount of RAM (size, %) allocated by the user 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 Buildtag string Release string } MonitoringProfile domain.MonitorProfile datastore.VersionedEntity NatIP string }
Host that runs the control center agent.
func Build ¶
func Build(ip string, rpcport string, poolid string, memory string, ipAddrs ...string) (*Host, error)
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 port 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 HostStatus ¶
type InvalidIPAddress ¶
type InvalidIPAddress string
InvalidIPAddress is an error for Invalid IPs
func (InvalidIPAddress) Error ¶
func (err InvalidIPAddress) Error() string
type IsLoopbackError ¶
type IsLoopbackError string
IsLoopbackError is an error type for IP addresses that are loopback.
func (IsLoopbackError) Error ¶
func (err IsLoopbackError) Error() string
type ReadHost ¶
type ReadHost struct { ID string Name string PoolID string Cores int Memory uint64 RAMLimit string KernelVersion string KernelRelease string ServiceD ReadServiced IPs []HostIPResource CreatedAt time.Time UpdatedAt time.Time }
ReadHost is a minimal representation of hosts.
type ReadServiced ¶
type Store ¶
type Store interface { datastore.EntityStore // FindHostsWithPoolID returns all hosts with the given poolid. FindHostsWithPoolID(ctx datastore.Context, poolID string) ([]Host, error) // GetHostByIP looks up a host by the given ip address GetHostByIP(ctx datastore.Context, hostIP string) (*Host, error) // GetN returns all hosts up to limit. GetN(ctx datastore.Context, limit uint64) ([]Host, error) }
Store type for interacting with Host persistent storage