// Status 判断状态码是否与 status 相等，若不相等，则返回 msg 指定的消息
//
// msg 可以为空，会返回一个默认的错误提示信息
487754
func (resp *Response) Status(status int, msg ...interface{}) *Response {
	resp.assertion.Equal(resp.resp.StatusCode, status, msg...)

	return resp
}
1281307
func (m *Machine) Status() (params.StatusResult, error) {
	var results params.StatusResults
	args := params.Entities{Entities: []params.Entity{
		{Tag: m.tag.String()},
	}}
	err := m.facade.FacadeCall("Status", args, &results)
	if err != nil {
		return params.StatusResult{}, errors.Trace(err)
	}
	if len(results.Results) != 1 {
		err := errors.Errorf("expected 1 result, got %d", len(results.Results))
		return params.StatusResult{}, err
	}
	result := results.Results[0]
	if result.Error != nil {
		return params.StatusResult{}, result.Error
	}
	return result, nil
}
511316
func (c *Client) Status() (*status.Status, error) {
	type statusResponse struct {
		Data status.Status `json:"data"`
	}
	s := &statusResponse{}
	if err := c.Get(status.Path, s); err != nil {
		return nil, err
	}
	return &s.Data, nil
}
829532
func (m *TimerMetrics) Status(startTime time.Time) {
	if m.statusEvery == 0 {
		return
	}
	m.StatusDuration(time.Now().Sub(startTime))
}
757726
func (s *Health) Status() string {
	s.mu.Lock()
	defer s.mu.Unlock()

	// This happens when the monitor has yet to be setup.
	if s.Health.Status == "" {
		return types.Unhealthy
	}

	return s.Health.Status
}
251478
func Status(status int) {
	if r, ok := responseDefinition(); ok {
		r.Status = status
	}
}
1273516
func Status(serviceName string,
	serviceDescription string,
	redact bool,
	logger *logrus.Logger) error {
	return errors.New("Status not supported for this binary")
}
452653
func (driver *MesosSchedulerDriver) Status() mesos.Status {
	driver.eventLock.RLock()
	defer driver.eventLock.RUnlock()
	return driver.status
}
1217106
func (o *oracleInstance) Status(ctx context.ProviderCallContext) instance.Status {
	return o.status
}
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
}
127404
func (tx *Tx) Status() int8 {
	if tx.status == TxStatusInProgress && tx.conn.txStatus == 'E' {
		return TxStatusInFailure
	}
	return tx.status
}
1355717
func (ls *LState) Status(th *LState) string {
	status := "suspended"
	if th.Dead {
		status = "dead"
	} else if ls.G.CurrentThread == th {
		status = "running"
	} else if ls.Parent == th {
		status = "normal"
	}
	return status
}
1113764
func (r *AnalyticsDeferredResultHandle) Status() (string, error) {
	req := &gocbcore.HttpRequest{
		Service:  gocbcore.CbasService,
		Endpoint: r.handleUri,
		Method:   "GET",
	}

	var resp *analyticsResponseHandle
	err := r.executeHandle(req, &resp)
	if err != nil {
		return "", err
	}

	r.status = resp.Status
	if r.status == "success" {
		r.handleUri = resp.Handle
	}
	return r.status, nil
}
733103
func (srv *Instance) Status() *InstanceStatus {
	stats := srv.Stats()

	return &InstanceStatus{
		Identity:        srv.cfg.Identity,
		Uptime:          srv.UpTime(),
		ConnectedServer: srv.ConnectedServer(),
		LastMessage:     srv.LastProcessedMessage().Unix(),
		Provisioning:    srv.Provisioning(),
		Stats:           &stats,
	}
}
320631
func (n *NodeService) Status() (*NodeStatus, *http.Response, error) {
	return n.StatusWithContext(context.TODO())
}
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
}
210679
func (c *criClient) Status() *models.Status {
	if c == nil {
		return &models.Status{State: models.StatusStateDisabled}
	}

	sreq := &criRuntime.StatusRequest{
		Verbose: false,
	}
	sresp, err := c.RuntimeServiceClient.Status(context.Background(), sreq)
	if err != nil {
		return &models.Status{State: models.StatusStateFailure, Msg: err.Error()}
	}
	for _, runtimeCondition := range sresp.Status.Conditions {
		if !runtimeCondition.Status {
			return &models.Status{State: models.StatusStateFailure, Msg: runtimeCondition.Message}
		}

	}
	return &models.Status{State: models.StatusStateOk, Msg: "cri daemon: Ok"}
}