func (c *Client) StatusHistory(kind status.HistoryKind, tag names.Tag, filter status.StatusHistoryFilter) (status.History, error) {
	var results params.StatusHistoryResults
	args := params.StatusHistoryRequest{
		Kind: string(kind),
		Filter: params.StatusHistoryFilter{
			Size:    filter.Size,
			Date:    filter.FromDate,
			Delta:   filter.Delta,
			Exclude: filter.Exclude.Values(),
		},
		Tag: tag.String(),
	}
	bulkArgs := params.StatusHistoryRequests{Requests: []params.StatusHistoryRequest{args}}
	err := c.facade.FacadeCall("StatusHistory", bulkArgs, &results)
	if err != nil {
		return status.History{}, errors.Trace(err)
	}
	if len(results.Results) != 1 {
		return status.History{}, errors.Errorf("expected 1 result got %d", len(results.Results))
	}
	if results.Results[0].Error != nil {
		return status.History{}, errors.Annotatef(results.Results[0].Error, "while processing the request")
	}
	history := make(status.History, len(results.Results[0].History.Statuses))
	if results.Results[0].History.Error != nil {
		return status.History{}, results.Results[0].History.Error
	}
	for i, h := range results.Results[0].History.Statuses {
		history[i] = status.DetailedStatus{
			Status: status.Status(h.Status),
			Info:   h.Info,
			Data:   h.Data,
			Since:  h.Since,
			Kind:   status.HistoryKind(h.Kind),
		}
		// TODO(perrito666) https://launchpad.net/bugs/1577589
		if !history[i].Kind.Valid() {
			logger.Errorf("history returned an unknown status kind %q", h.Kind)
		}
	}
	return history, nil
}
// StatusHistory retrieves the last <size> results of
// <kind:combined|agent|workload|machine|machineinstance|container|containerinstance> status
// for <name> unit
StatusHistory retrieves the last  results of
 status
for  unit
// StatusHistory retrieves the last <size > results of // <kind : combined|agent|workload|machine|machineinstance|container|containerinstance > status // for <name > unit
func (c *Client) StatusHistory(kind status.HistoryKind, tag names.Tag, filter status.StatusHistoryFilter) (status.History, error) {
	var results params.StatusHistoryResults
	args := params.StatusHistoryRequest{
		Kind: string(kind),
		Filter: params.StatusHistoryFilter{
			Size:    filter.Size,
			Date:    filter.FromDate,
			Delta:   filter.Delta,
			Exclude: filter.Exclude.Values(),
		},
		Tag: tag.String(),
	}
	bulkArgs := params.StatusHistoryRequests{Requests: []params.StatusHistoryRequest{args}}
	err := c.facade.FacadeCall("StatusHistory", bulkArgs, &results)
	if err != nil {
		return status.History{}, errors.Trace(err)
	}
	if len(results.Results) != 1 {
		return status.History{}, errors.Errorf("expected 1 result got %d", len(results.Results))
	}
	if results.Results[0].Error != nil {
		return status.History{}, errors.Annotatef(results.Results[0].Error, "while processing the request")
	}
	history := make(status.History, len(results.Results[0].History.Statuses))
	if results.Results[0].History.Error != nil {
		return status.History{}, results.Results[0].History.Error
	}
	for i, h := range results.Results[0].History.Statuses {
		history[i] = status.DetailedStatus{
			Status: status.Status(h.Status),
			Info:   h.Info,
			Data:   h.Data,
			Since:  h.Since,
			Kind:   status.HistoryKind(h.Kind),
		}
		if !history[i].Kind.Valid() {
			logger.Errorf("history returned an unknown status kind %q", h.Kind)
		}
	}
	return history, nil
}
func ( c * Client ) StatusHistory ( kind status . HistoryKind , tag names . Tag , filter status . StatusHistoryFilter ) ( status . History , error ) { var results params . StatusHistoryResults args := params . StatusHistoryRequest { Kind : string ( kind ) , Filter : params . StatusHistoryFilter { Size : filter . Size , Date : filter . FromDate , Delta : filter . Delta , Exclude : filter . Exclude . Values ( ) , } , Tag : tag . String ( ) , } bulkArgs := params . StatusHistoryRequests { Requests : [ ] params . StatusHistoryRequest { args } } err := c . facade . FacadeCall ( " " , bulkArgs , & results ) if err != nil { return status . History { } , errors . Trace ( err ) } if len ( results . Results ) != 1 { return status . History { } , errors . Errorf ( " " , len ( results . Results ) ) } if results . Results [ 0 ] . Error != nil { return status . History { } , errors . Annotatef ( results . Results [ 0 ] . Error , " " ) } history := make ( status . History , len ( results . Results [ 0 ] . History . Statuses ) ) if results . Results [ 0 ] . History . Error != nil { return status . History { } , results . Results [ 0 ] . History . Error } for i , h := range results . Results [ 0 ] . History . Statuses { history [ i ] = status . DetailedStatus { Status : status . Status ( h . Status ) , Info : h . Info , Data : h . Data , Since : h . Since , Kind : status . HistoryKind ( h . Kind ) , } if ! history [ i ] . Kind . Valid ( ) { logger . Errorf ( " " , h . Kind ) } } return history , nil }
StatusHistory retrieves the last  results of
status
for  unit
StatusHistory retrieves the last results of status for unit
// TODO(perrito666) https://launchpad.net/bugs/1577589