// Machine provides access to methods of a state.Machine through the // facade. func (api *API) Machine(tag names.MachineTag) (*Machine, error) { life, err := common.Life(api.facade, tag) if err != nil { return nil, errors.Trace(err) } return &Machine{api.facade, tag, life}, nil }
// Refresh updates the cached local copy of the unit's data. func (u *Unit) Refresh() error { life, err := common.Life(u.st.facade, u.tag) if err != nil { return err } u.life = life return nil }
// Refresh updates the cached local copy of the IP address's data. func (a *IPAddress) Refresh() error { life, err := common.Life(a.facade, a.tag) if err != nil { return errors.Trace(err) } a.life = life return nil }
// Refresh updates the cached local copy of the machine's data. func (m *Machine) Refresh() error { life, err := common.Life(m.facade, m.tag) if err != nil { return errors.Trace(err) } m.life = life return nil }
// IPAddress provides access to methods of a state.IPAddress through the // facade. func (api *API) IPAddress(tag names.IPAddressTag) (*IPAddress, error) { // TODO(mue) Change approach to use bulk requests for retrieval // and later removal. life, err := common.Life(api.facade, tag) if err != nil { return nil, errors.Trace(err) } return &IPAddress{api.facade, tag, life}, nil }
// life requests the lifecycle of the given entity from the server. func (st *State) life(tag names.Tag) (params.Life, error) { return common.Life(st.facade, tag) }
// machineLife requests the lifecycle of the given machine from the server. func (st *State) machineLife(tag names.MachineTag) (params.Life, error) { return common.Life(st.facade, tag) }