// GetStatus returns pool's height, numPending requests and the number of
// requesters.
327595
func (pool *BlockPool) GetStatus() (height int64, numPending int32, lenRequesters int) {
	pool.mtx.Lock()
	defer pool.mtx.Unlock()

	return pool.height, atomic.LoadInt32(&pool.numPending), len(pool.requesters)
}
603138
func (i *Import) GetStatus() string {
	if i == nil || i.Status == nil {
		return ""
	}
	return *i.Status
}
1034144
func getStatus(err error) int {
	// no error
	if err == nil {
		return 200
	}

	// try get errors.Error
	if e, ok := err.(*errors.Error); ok {
		return int(e.Code)
	}

	// try parse marshalled error
	if e := errors.Parse(err.Error()); e.Code > 0 {
		return int(e.Code)
	}

	// could not parse, 500
	return 500
}
885225
func getHostStatuses(w *rest.ResponseWriter, r *rest.Request, ctx *requestContext) {
	facade := ctx.getFacade()
	dataCtx := ctx.getDatastoreContext()

	values := r.URL.Query()

	var hostIDs []string
	if _, ok := values["hostId"]; ok {
		hostIDs = values["hostId"]
	} else {
		hosts, err := facade.GetReadHosts(dataCtx)
		if err != nil {
			restServerError(w, err)
			return
		}

		hostIDs = make([]string, len(hosts))
		for i, host := range hosts {
			hostIDs[i] = host.ID
		}
	}

	since := values.Get("since")
	var duration time.Duration
	if since == "" {
		duration = time.Hour
	} else {
		tint, err := strconv.ParseInt(since, 10, 64)
		if err != nil {
			restServerError(w, err)
			return
		}
		duration = time.Duration(tint) * time.Millisecond
	}

	statuses, err := facade.GetHostStatuses(dataCtx, hostIDs, time.Now().Add(-duration))
	if err != nil {
		restServerError(w, err)
		return
	}

	w.WriteJson(statuses)
}
869383
func (l *ListCheckRunsOptions) GetStatus() string {
	if l == nil || l.Status == nil {
		return ""
	}
	return *l.Status
}
78945
func GetTaskStatus(tx *bolt.Tx, id string) (*api.TaskStatus, error) {
	var ts api.TaskStatus
	if err := withTaskBucket(tx, id, func(bkt *bolt.Bucket) error {
		p := bkt.Get(bucketKeyStatus)
		if p == nil {
			return errTaskUnknown
		}

		return proto.Unmarshal(p, &ts)
	}); err != nil {
		return nil, err
	}

	return &ts, nil
}
375845
func (s *Http) SetHttpStatus(v int64) *Http {
	s.HttpStatus = &v
	return s
}
1165389
func (m *Machine) InstanceStatus() (status.StatusInfo, error) {
	machineStatus, err := getStatus(m.st.db(), m.globalInstanceKey(), "instance")
	if err != nil {
		logger.Warningf("error when retrieving instance status for machine: %s, %v", m.Id(), err)
		return status.StatusInfo{}, err
	}
	return machineStatus, nil
}
17458
func (h *Handler) handleGetStatus(w http.ResponseWriter, r *http.Request) {
	if !validHeaderAcceptJSON(r.Header) {
		http.Error(w, "JSON only acceptable response", http.StatusNotAcceptable)
		return
	}
	status := getStatusResponse{
		State:   h.api.State(),
		Nodes:   h.api.Hosts(r.Context()),
		LocalID: h.api.Node().ID,
	}
	if err := json.NewEncoder(w).Encode(status); err != nil {
		h.logger.Printf("write status response error: %s", err)
	}
}
905232
func (r *Repository) GetStatusesURL() string {
	if r == nil || r.StatusesURL == nil {
		return ""
	}
	return *r.StatusesURL
}
345102
func (r Account_Agreement) GetStatus() (resp datatypes.Account_Agreement_Status, err error) {
	err = r.Session.DoRequest("SoftLayer_Account_Agreement", "getStatus", nil, &r.Options, &resp)
	return
}
572802
func NewStatusGetter(st state.EntityFinder, getCanAccess GetAuthFunc) *StatusGetter {
	return &StatusGetter{
		st:           st,
		getCanAccess: getCanAccess,
	}
}
19407
func GetRBDStatus(
	ctx types.Context,
	pool, image *string) (map[string]interface{}, error) {

	cmd := exec.Command(
		rbdCmd, "status", poolOpt, *pool, *image, formatOpt, jsonArg,
	)
	out, _, err := RunCommand(ctx, cmd)
	if err != nil {
		return nil, goof.WithError("unable to get rbd status", err)
	}

	watcherMap := map[string]interface{}{}

	err = json.Unmarshal(out, &watcherMap)
	if err != nil {
		return nil, goof.WithError(
			"Unable to parse rbd status", err)
	}

	return watcherMap, nil
}
694179
func (suite *Suite) numStatus(status Status) int {
	count := 0
	for _, test := range suite.Tests {
		if test.Status == status {
			count++
		}
	}
	return count
}
1362351
func (r Scale_Group) GetStatus() (resp datatypes.Scale_Group_Status, err error) {
	err = r.Session.DoRequest("SoftLayer_Scale_Group", "getStatus", nil, &r.Options, &resp)
	return
}
155620
func (r Virtual_Guest) GetStatus() (resp datatypes.Virtual_Guest_Status, err error) {
	err = r.Session.DoRequest("SoftLayer_Virtual_Guest", "getStatus", nil, &r.Options, &resp)
	return
}
540982
func StatusHandler(w http.ResponseWriter, r *http.Request) {
	if r.Method == "GET" {
		checks := CheckStatus()
		status := http.StatusOK

		// If there is an error, return 503
		if len(checks) != 0 {
			status = http.StatusServiceUnavailable
		}

		statusResponse(w, r, status, checks)
	} else {
		http.NotFound(w, r)
	}
}