func (r AddrMap) AppendSysResource(sr string, sys *system.System, config util.Config) (*Addr, error) { sysres := sys.NewAddr(sr, sys, config) res, err := NewAddr(sysres, config) if err != nil { return nil, err } r[res.ID()] = res return res, nil }
func (r AddrMap) AppendSysResourceIfExists(sr string, sys *system.System) (*Addr, system.Addr, bool) { sysres := sys.NewAddr(sr, sys) res := NewAddr(sysres) if e, _ := sysres.Exists(); e != true { return res, sysres, false } r[res.ID()] = res return res, sysres, true }
func (r AddrMap) AppendSysResourceIfExists(sr string, sys *system.System) (*Addr, system.Addr, bool) { sysres := sys.NewAddr(sr, sys, util.Config{}) // FIXME: Do we want to be silent about errors? res, _ := NewAddr(sysres, util.Config{}) if e, _ := sysres.Exists(); e != true { return res, sysres, false } r[res.ID()] = res return res, sysres, true }
func (h *Addr) Validate(sys *system.System) []TestResult { sysAddr := sys.NewAddr(h.Address, sys) sysAddr.Timeout = h.Timeout var results []TestResult results = append(results, ValidateValue(h.Address, "reachable", h.Reachable, sysAddr.Reachable)) return results }
func (a *Addr) Validate(sys *system.System) []TestResult { skip := false if a.Timeout == 0 { a.Timeout = 500 } sysAddr := sys.NewAddr(a.Address, sys, util.Config{Timeout: a.Timeout}) var results []TestResult results = append(results, ValidateValue(a, "reachable", a.Reachable, sysAddr.Reachable, skip)) return results }
func (r AddrMap) AppendSysResource(sr string, sys *system.System, config util.Config) (*Addr, error) { sysres := sys.NewAddr(sr, sys, config) res, err := NewAddr(sysres, config) if err != nil { return nil, err } if old_res, ok := r[res.ID()]; ok { res.Title = old_res.Title res.Meta = old_res.Meta } r[res.ID()] = res return res, nil }
func (r AddrMap) AppendSysResource(sr string, sys *system.System) (*Addr, system.Addr) { sysres := sys.NewAddr(sr, sys) res := NewAddr(sysres) r[res.ID()] = res return res, sysres }