當前位置: 首頁>>代碼示例>>Golang>>正文


Golang params.ErrorResults類代碼示例

本文整理匯總了Golang中launchpad/net/juju-core/state/api/params.ErrorResults的典型用法代碼示例。如果您正苦於以下問題:Golang ErrorResults類的具體用法?Golang ErrorResults怎麽用?Golang ErrorResults使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了ErrorResults類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: EnsureDead

// EnsureDead sets the machine lifecycle to Dead if it is Alive or
// Dying. It does nothing otherwise.
func (m *Machine) EnsureDead() error {
	var result params.ErrorResults
	args := params.Entities{
		Entities: []params.Entity{{Tag: m.tag}},
	}
	err := m.st.caller.Call("Machiner", "", "EnsureDead", args, &result)
	if err != nil {
		return err
	}
	return result.OneError()
}
開發者ID:hivetech,項目名稱:judo.legacy,代碼行數:13,代碼來源:machine.go

示例2: EnsureDead

// EnsureDead sets the unit lifecycle to Dead if it is Alive or
// Dying. It does nothing otherwise.
func (u *Unit) EnsureDead() error {
	var result params.ErrorResults
	args := params.Entities{
		Entities: []params.Entity{{Tag: u.tag}},
	}
	err := u.st.caller.Call("Uniter", "", "EnsureDead", args, &result)
	if err != nil {
		return err
	}
	return result.OneError()
}
開發者ID:hivetech,項目名稱:judo.legacy,代碼行數:13,代碼來源:unit.go

示例3: Remove

// Remove removes the unit from state, calling EnsureDead first, then Remove.
// It will fail if the unit is not present.
func (u *Unit) Remove() error {
	var result params.ErrorResults
	args := params.Entities{
		Entities: []params.Entity{{Tag: u.tag}},
	}
	err := u.st.caller.Call("Deployer", "", "Remove", args, &result)
	if err != nil {
		return err
	}
	return result.OneError()
}
開發者ID:hivetech,項目名稱:judo.legacy,代碼行數:13,代碼來源:unit.go

示例4: SetStatus

// SetStatus sets the status of the machine.
func (m *Machine) SetStatus(status params.Status, info string) error {
	var result params.ErrorResults
	args := params.SetStatus{
		Entities: []params.SetEntityStatus{
			{Tag: m.tag, Status: status, Info: info},
		},
	}
	err := m.st.caller.Call("Machiner", "", "SetStatus", args, &result)
	if err != nil {
		return err
	}
	return result.OneError()
}
開發者ID:hivetech,項目名稱:judo.legacy,代碼行數:14,代碼來源:machine.go

示例5: SetPassword

// SetPassword sets the unit's password.
func (u *Unit) SetPassword(password string) error {
	var result params.ErrorResults
	args := params.PasswordChanges{
		Changes: []params.PasswordChange{
			{Tag: u.tag, Password: password},
		},
	}
	err := u.st.caller.Call("Deployer", "", "SetPasswords", args, &result)
	if err != nil {
		return err
	}
	return result.OneError()
}
開發者ID:hivetech,項目名稱:judo.legacy,代碼行數:14,代碼來源:unit.go

示例6: SetPassword

// SetPassword sets the password associated with the agent's entity.
func (m *Entity) SetPassword(password string) error {
	var results params.ErrorResults
	args := params.PasswordChanges{
		Changes: []params.PasswordChange{{
			Tag:      m.tag,
			Password: password,
		}},
	}
	err := m.st.caller.Call("Agent", "", "SetPasswords", args, &results)
	if err != nil {
		return err
	}
	return results.OneError()
}
開發者ID:hivetech,項目名稱:judo.legacy,代碼行數:15,代碼來源:state.go

示例7: SetTools

// SetTools sets the tools associated with the entity
// with the given tag, which must be the tag
// of the entity that the upgrader is running
// on behalf of.
func (st *State) SetTools(tag string, tools *tools.Tools) error {
	var results params.ErrorResults
	args := params.SetAgentsTools{
		AgentTools: []params.SetAgentTools{{
			Tag:   tag,
			Tools: tools,
		}},
	}
	err := st.caller.Call("Upgrader", "", "SetTools", args, &results)
	if err != nil {
		// TODO: Not directly tested
		return err
	}
	return results.OneError()
}
開發者ID:hivetech,項目名稱:judo.legacy,代碼行數:19,代碼來源:upgrader.go


注:本文中的launchpad/net/juju-core/state/api/params.ErrorResults類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。