Esempio n. 1
0
// 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
}
Esempio n. 2
0
File: unit.go Progetto: imoapps/juju
// 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
}
Esempio n. 3
0
// 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
}
Esempio n. 4
0
// 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
}
Esempio n. 5
0
// 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
}
Esempio n. 6
0
// 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)
}
Esempio n. 7
0
// 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)
}