~juju-qa/ubuntu/xenial/juju/2.0-rc2

« back to all changes in this revision

Viewing changes to src/github.com/juju/juju/api/deployer/unit.go

  • Committer: Nicholas Skaggs
  • Date: 2016-09-30 14:39:30 UTC
  • mfrom: (1.8.1)
  • Revision ID: nicholas.skaggs@canonical.com-20160930143930-vwwhrefh6ftckccy
import upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
 
9
9
        "github.com/juju/juju/api/common"
10
10
        "github.com/juju/juju/apiserver/params"
 
11
        "github.com/juju/juju/status"
11
12
)
12
13
 
13
14
// Unit represents a juju unit as seen by the deployer worker.
70
71
        }
71
72
        return result.OneError()
72
73
}
 
74
 
 
75
// SetStatus sets the status of the unit.
 
76
func (u *Unit) SetStatus(unitStatus status.Status, info string, data map[string]interface{}) error {
 
77
        var result params.ErrorResults
 
78
        args := params.SetStatus{
 
79
                Entities: []params.EntityStatusArgs{
 
80
                        {Tag: u.tag.String(), Status: unitStatus.String(), Info: info, Data: data},
 
81
                },
 
82
        }
 
83
        err := u.st.facade.FacadeCall("SetStatus", args, &result)
 
84
        if err != nil {
 
85
                return err
 
86
        }
 
87
        return result.OneError()
 
88
}