Python reference for OpenLMI client scripts
Main interface functions wrapped with lmi commands are:
All of these accept ns object as the first argument.
It is an instance of lmi.shell.LMINamespace.
Power Management Module API
LMI power management provider client library.
-
lmi.scripts.powermanagement.POWER_STATE_HIBERNATE = 7
Hibernate the system.
-
lmi.scripts.powermanagement.POWER_STATE_POWEROFF = 12
Turn off the system.
-
lmi.scripts.powermanagement.POWER_STATE_POWEROFF_FORCE = 8
Turn off the system without shutting down services first.
-
lmi.scripts.powermanagement.POWER_STATE_REBOOT = 15
Reboot the system.
-
lmi.scripts.powermanagement.POWER_STATE_REBOOT_FORCE = 5
Reboot the system without shutting down services first.
-
lmi.scripts.powermanagement.POWER_STATE_SUSPEND = 4
Suspend the system.
-
lmi.scripts.powermanagement.list_power_states(ns)[source]
Get list of available power states.
Returns: | list of power states |
Return type: | list of POWER_STATE_* constants |
-
lmi.scripts.powermanagement.switch_power_state(ns, state)[source]
Switch system power state.
Parameters: | state (POWER_STATE_* constant) – Requested power state. |