// GetIncidents returns a list of the 50 most recent incidents.
// This includes all unresolved incidents returned in GetUnresolvedIncidents, as well as those in the Resolved and Postmortem state.
968190
func (c *Client) GetIncidents() (IncidentsResponse, error) {
	i := IncidentsResponse{}
	err := c.request("api/v2/incidents.json", &i)
	return i, err
}
212792
func (c *StatsConnection) GetErrorStats(names ...string) (*api.ErrorStats, error) {
	var patterns []string
	if len(names) > 0 {
		patterns = make([]string, len(names))
		for i, name := range names {
			patterns[i] = CounterStatsPrefix + name
		}
	} else {
		// retrieve all error counters by default
		patterns = []string{CounterStatsPrefix}
	}
	stats, err := c.statsClient.DumpStats(patterns...)
	if err != nil {
		return nil, err
	}

	var errorStats = &api.ErrorStats{}

	for _, stat := range stats {
		statName := strings.TrimPrefix(stat.Name, CounterStatsPrefix)

		/* TODO: deal with stats that contain '/' in node/counter name
		parts := strings.Split(statName, "/")
		var nodeName, counterName string
		switch len(parts) {
		case 2:
			nodeName = parts[0]
			counterName = parts[1]
		case 3:
			nodeName = parts[0] + parts[1]
			counterName = parts[2]
		}*/

		errorStats.Errors = append(errorStats.Errors, api.ErrorCounter{
			CounterName: statName,
			Value:       errorStatToUint64(stat.Data),
		})
	}

	return errorStats, nil
}
980700
func (m *LinkOrReference) ResolveReferences(root string) (interface{}, error) {
	errors := make([]error, 0)
	{
		p, ok := m.Oneof.(*LinkOrReference_Link)
		if ok {
			_, err := p.Link.ResolveReferences(root)
			if err != nil {
				return nil, err
			}
		}
	}
	{
		p, ok := m.Oneof.(*LinkOrReference_Reference)
		if ok {
			_, err := p.Reference.ResolveReferences(root)
			if err != nil {
				return nil, err
			}
		}
	}
	return nil, compiler.NewErrorGroupOrNil(errors)
}
522840
func (c *Collector) GetStaleProbes() map[string]time.Time {
	c.RLock()
	defer c.RUnlock()

	probes := make(map[string]time.Time)

	for p := range c.staleProbes {
		probes[p] = c.probeStartTime[p]
	}

	return probes
}
913944
func (md *RootMetadataV2) GetUnresolvedParticipants() []keybase1.SocialAssertion {
	writers := md.WriterMetadataV2.Extra.UnresolvedWriters
	readers := md.UnresolvedReaders
	users := make([]keybase1.SocialAssertion, 0, len(writers)+len(readers))
	users = append(users, writers...)
	users = append(users, readers...)
	return users
}
79898
func (u *UsersSearchResult) GetIncompleteResults() bool {
	if u == nil || u.IncompleteResults == nil {
		return false
	}
	return *u.IncompleteResults
}
639045
func (m *HeaderOrReference) ResolveReferences(root string) (interface{}, error) {
	errors := make([]error, 0)
	{
		p, ok := m.Oneof.(*HeaderOrReference_Header)
		if ok {
			_, err := p.Header.ResolveReferences(root)
			if err != nil {
				return nil, err
			}
		}
	}
	{
		p, ok := m.Oneof.(*HeaderOrReference_Reference)
		if ok {
			_, err := p.Reference.ResolveReferences(root)
			if err != nil {
				return nil, err
			}
		}
	}
	return nil, compiler.NewErrorGroupOrNil(errors)
}
700653
func (c *CommitFile) GetAdditions() int {
	if c == nil || c.Additions == nil {
		return 0
	}
	return *c.Additions
}
853774
func (m *JsonReference) ResolveReferences(root string) (interface{}, error) {
	errors := make([]error, 0)
	if m.XRef != "" {
		info, err := compiler.ReadInfoForRef(root, m.XRef)
		if err != nil {
			return nil, err
		}
		if info != nil {
			replacement, err := NewJsonReference(info, nil)
			if err == nil {
				*m = *replacement
				return m.ResolveReferences(root)
			}
		}
		return info, nil
	}
	return nil, compiler.NewErrorGroupOrNil(errors)
}
950768
func (n *NameProvider) GetJSONNames(subject interface{}) []string {
	n.lock.Lock()
	defer n.lock.Unlock()
	tpe := reflect.Indirect(reflect.ValueOf(subject)).Type()
	names, ok := n.index[tpe]
	if !ok {
		names = n.makeNameIndex(tpe)
	}

	res := make([]string, 0, len(names.jsonNames))
	for k := range names.jsonNames {
		res = append(res, k)
	}
	return res
}
217612
func (m *ExampleOrReference) ResolveReferences(root string) (interface{}, error) {
	errors := make([]error, 0)
	{
		p, ok := m.Oneof.(*ExampleOrReference_Example)
		if ok {
			_, err := p.Example.ResolveReferences(root)
			if err != nil {
				return nil, err
			}
		}
	}
	{
		p, ok := m.Oneof.(*ExampleOrReference_Reference)
		if ok {
			_, err := p.Reference.ResolveReferences(root)
			if err != nil {
				return nil, err
			}
		}
	}
	return nil, compiler.NewErrorGroupOrNil(errors)
}
813166
func (c *CommitFile) GetDeletions() int {
	if c == nil || c.Deletions == nil {
		return 0
	}
	return *c.Deletions
}
1160690
func (m *NamedMethod) ResolveReferences(root string) (interface{}, error) {
	errors := make([]error, 0)
	if m.Value != nil {
		_, err := m.Value.ResolveReferences(root)
		if err != nil {
			errors = append(errors, err)
		}
	}
	return nil, compiler.NewErrorGroupOrNil(errors)
}
628076
func (hri *HealResultItem) GetCorruptedCounts() (b, a int) {
	if hri == nil {
		return
	}
	for _, v := range hri.Before.Drives {
		if v.State == DriveStateCorrupt {
			b++
		}
	}
	for _, v := range hri.After.Drives {
		if v.State == DriveStateCorrupt {
			a++
		}
	}
	return
}
456669
func (d *Accessor) GetUnexpiredCertificates() (crs []certdb.CertificateRecord, err error) {
	err = d.checkDB()
	if err != nil {
		return nil, err
	}

	err = d.db.Select(&crs, fmt.Sprintf(d.db.Rebind(selectAllUnexpiredSQL), sqlstruct.Columns(certdb.CertificateRecord{})))
	if err != nil {
		return nil, wrapSQLError(err)
	}

	return crs, nil
}
1104165
func (vrsConnection *VRSConnection) GetAllEntities() ([]string, error) {
	readRowArgs := ovsdb.ReadRowArgs{
		Condition: []string{ovsdb.NuageVMTableColumnVMUUID, "!=", "xxxx"},
		Columns:   []string{ovsdb.NuageVMTableColumnVMUUID},
	}

	var uuidRows []map[string]interface{}
	var err error
	if uuidRows, err = vrsConnection.vmTable.ReadRows(vrsConnection.ovsdbClient, readRowArgs); err != nil {
		return []string{}, fmt.Errorf("Unable to obtain the entity uuids %v", err)
	}

	var uuids []string
	for _, uuid := range uuidRows {
		uuids = append(uuids, uuid[ovsdb.NuageVMTableColumnVMUUID].(string))
	}

	return uuids, nil
}
730239
func (_class CrashdumpClass) GetAll(sessionID SessionRef) (_retval []CrashdumpRef, _err error) {
	_method := "crashdump.get_all"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_result, _err := _class.client.APICall(_method, _sessionIDArg)
	if _err != nil {
		return
	}
	_retval, _err = convertCrashdumpRefSetToGo(_method + " -> ", _result.Value)
	return
}