// Status fetches status information for a node given by serial.
433732
func (c *Client) Status(serial string) (hostmgr.Host, error) {
	var host hostmgr.Host

	resp, err := http.Get(fmt.Sprintf("%s://%s:%d/admin/hosts", c.Scheme, c.Host, c.Port))
	if err != nil {
		return host, microerror.Mask(err)
	}
	defer resp.Body.Close()
	if resp.StatusCode > 399 {
		return host, microerror.Mask(fmt.Errorf("invalid status code '%d'", resp.StatusCode))
	}

	body, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		return host, microerror.Mask(err)
	}

	list := []hostmgr.Host{}
	err = json.Unmarshal(body, &list)
	if err != nil {
		return host, microerror.Mask(err)
	}

	for _, host = range list {
		if host.Serial == serial {
			return host, nil
		}
	}

	return host, microerror.Mask(fmt.Errorf("host %s not found", serial))
}
1181113
func (m *Monitor) Status() Status {
	m.mu.Lock()
	now := m.update(0)
	s := Status{
		Active:   m.active,
		Start:    clockToTime(m.start),
		Duration: m.sLast - m.start,
		Idle:     now - m.tLast,
		Bytes:    m.bytes,
		Samples:  m.samples,
		PeakRate: round(m.rPeak),
		BytesRem: m.tBytes - m.bytes,
		Progress: percentOf(float64(m.bytes), float64(m.tBytes)),
	}
	if s.BytesRem < 0 {
		s.BytesRem = 0
	}
	if s.Duration > 0 {
		rAvg := float64(s.Bytes) / s.Duration.Seconds()
		s.AvgRate = round(rAvg)
		if s.Active {
			s.InstRate = round(m.rSample)
			s.CurRate = round(m.rEMA)
			if s.BytesRem > 0 {
				if tRate := 0.8*m.rEMA + 0.2*rAvg; tRate > 0 {
					ns := float64(s.BytesRem) / tRate * 1e9
					if ns > float64(timeRemLimit) {
						ns = float64(timeRemLimit)
					}
					s.TimeRem = clockRound(time.Duration(ns))
				}
			}
		}
	}
	m.mu.Unlock()
	return s
}
828868
func (d *Driver) Status() [][2]string {
	status := [][2]string{}
	if bv := btrfsBuildVersion(); bv != "-" {
		status = append(status, [2]string{"Build Version", bv})
	}
	if lv := btrfsLibVersion(); lv != -1 {
		status = append(status, [2]string{"Library Version", fmt.Sprintf("%d", lv)})
	}
	return status
}
251478
func Status(status int) {
	if r, ok := responseDefinition(); ok {
		r.Status = status
	}
}
255534
func (s *PublicTxPoolAPI) Status() map[string]hexutil.Uint {
	pending, queue := s.b.Stats()
	return map[string]hexutil.Uint{
		"pending": hexutil.Uint(pending),
		"queued":  hexutil.Uint(queue),
	}
}
754789
func (w *trezorDriver) Status() (string, error) {
	if w.failure != nil {
		return fmt.Sprintf("Failed: %v", w.failure), w.failure
	}
	if w.device == nil {
		return "Closed", w.failure
	}
	if w.pinwait {
		return fmt.Sprintf("Trezor v%d.%d.%d '%s' waiting for PIN", w.version[0], w.version[1], w.version[2], w.label), w.failure
	}
	return fmt.Sprintf("Trezor v%d.%d.%d '%s' online", w.version[0], w.version[1], w.version[2], w.label), w.failure
}
452174
func (c *contextMachine) Status() (status.StatusInfo, error) {
	return c.context.status.MachineAgent(c.Id())
}
487754
func (resp *Response) Status(status int, msg ...interface{}) *Response {
	resp.assertion.Equal(resp.resp.StatusCode, status, msg...)

	return resp
}
750690
func (d *dockerClient) Status() *models.Status {
	if d == nil {
		return &models.Status{State: models.StatusStateDisabled}
	}

	if _, err := d.Info(ctx.Background()); err != nil {
		return &models.Status{State: models.StatusStateFailure, Msg: "docker daemon: " + err.Error()}
	}

	return &models.Status{State: models.StatusStateOk, Msg: "docker daemon: OK"}
}
128034
func (o *ociInstance) Status(ctx envcontext.ProviderCallContext) instance.Status {
	if err := o.refresh(); err != nil {
		common.HandleCredentialError(err, ctx)
		return instance.Status{}
	}
	state, ok := statusMap[o.raw.LifecycleState]
	if !ok {
		state = status.Unknown
	}
	return instance.Status{
		Status:  state,
		Message: strings.ToLower(string(o.raw.LifecycleState)),
	}
}
1327529
func (ctx *Context) Status() ([]StatusItem, error) {
	var err error
	if !ctx.loaded || ctx.dirty {
		err = ctx.loadPackage()
		if err != nil {
			return nil, err
		}
	}
	if ctx.statusCache == nil {
		err = ctx.updateStatusCache()
		if err != nil {
			return nil, err
		}
	}
	return ctx.statusCache, nil
}
191570
func (f Future) Status() string {
	if f.pt == nil {
		return ""
	}
	return f.pt.pollingStatus()
}
925225
func (m *Master) Status() (err error) {
	u := url.URL{
		Scheme: "http",
		Host:   m.Url,
		Path:   "/dir/status",
	}
	resp, err := http.Get(u.String())
	if err != nil {
		return
	}

	defer resp.Body.Close()

	status := new(systemStatus)
	if err = decodeJson(resp.Body, status); err != nil {
		log.Println(err)
		return
	}

	if status.Error != "" {
		err = errors.New(status.Error)
		log.Println(err)
		return
	}
	return
}
332113
func (dbCallback *DbCallbackImplied) Status(phase WorkerPhase, worker *DbWorker) {
	if dbCallback.StatusFn != nil {
		dbCallback.StatusFn(phase, worker)
	}
}
72893
func (f *RemoteRuntime) Status(ctx context.Context, req *kubeapi.StatusRequest) (*kubeapi.StatusResponse, error) {
	status, err := f.RuntimeService.Status()
	if err != nil {
		return nil, err
	}

	return &kubeapi.StatusResponse{Status: status}, nil
}
151966
func (i sigmaInstance) Status(ctx context.ProviderCallContext) instance.Status {
	entityStatus := i.server.Status()
	logger.Tracef("sigmaInstance.Status: %s", entityStatus)
	jujuStatus := status.Pending
	switch entityStatus {
	case gosigma.ServerStarting:
		jujuStatus = status.Allocating
	case gosigma.ServerRunning:
		jujuStatus = status.Running
	case gosigma.ServerStopping, gosigma.ServerStopped:
		jujuStatus = status.Empty
	case gosigma.ServerUnavailable:
		// I am not sure about this one.
		jujuStatus = status.Pending
	default:
		jujuStatus = status.Pending
	}

	return instance.Status{
		Status:  jujuStatus,
		Message: entityStatus,
	}

}
143029
func (w *keystoreWallet) Status() (string, error) {
	w.keystore.mu.RLock()
	defer w.keystore.mu.RUnlock()

	if _, ok := w.keystore.unlocked[w.account.Address]; ok {
		return "Unlocked", nil
	}
	return "Locked", nil
}