ironic.drivers.modules.agent_power module¶
The agent power interface.
- class ironic.drivers.modules.agent_power.AgentPower(*args, **kwargs)[source]¶
Bases:
PowerInterface
Power interface using the running agent for power actions.
- get_power_state(task)[source]¶
Return the power state of the task’s node.
Essentially, the only known state is POWER ON, everything else is an error (or more precisely
None
).- Parameters:
task – A TaskManager instance containing the node to act on.
- Returns:
A power state. One of
ironic.common.states
.
- get_properties()[source]¶
Return the properties of the interface.
- Returns:
dictionary of <property name>:<property description> entries.
- get_supported_power_states(task)[source]¶
Get a list of the supported power states.
Only contains REBOOT.
- Parameters:
task – A TaskManager instance containing the node to act on.
- Returns:
A list with the supported power states defined in
ironic.common.states
.
- reboot(task, timeout=None)[source]¶
Perform a reboot of the task’s node.
Only soft reboot is implemented.
- Parameters:
task – A TaskManager instance containing the node to act on.
timeout – timeout (in seconds) positive integer (> 0) for any power state.
None
indicates to use default timeout.
- set_power_state(task, power_state, timeout=None)[source]¶
Set the power state of the task’s node.
- Parameters:
task – A TaskManager instance containing the node to act on.
power_state – Power state from
ironic.common.states
. Only REBOOT and SOFT_REBOOT are supported and are synonymous.timeout – timeout (in seconds) positive integer (> 0) for any power state.
None
indicates to use default timeout.
- Raises:
PowerStateFailure on non-supported power state.
- supports_power_sync(task)[source]¶
Check if power sync is supported for the given node.
Not supported for the agent power since it is not possible to power on/off nodes.
- Parameters:
task – A TaskManager instance containing the node to act on with a shared lock.
- Returns:
boolean, whether power sync is supported.