Usage¶
Quickstart¶
Wry’s functionality is exposed through the AMTDevice class. Initialize it as such:
>>> from wry import AMTDevice
>>> dev = AMTDevice(address, 'http', username, password)
You can then access different apects of device functionality, through aspect-specific namespaces. For example:
>>> dev.power.turn_on()
>>> dev.power.state
StateMap(state='on', sub_state=None)
Currently, the following namespaces are implemented:
- dev.power, via
wry.AMTPower, provides access to:
- Power state and control
- dev.boot, via
wry.AMTBoot, provides access to:
- Boot configuration
- Boot medium selection
- dev.vnc, via
wry.AMTKVM, provides access to:
- Remote KVM (VNC) state and configuration
- Setting of [additonal] user opt-in policy for KVM
- dev.opt_in, via
wry.AMTOptIn, provides access to:
- Setting of opt-in policies for KVM, Serial-over-LAN and media redirection
- dev.redirection, via
wry.AMTRedirection, provides access to:
- State and control of media redirection (IDER)
- State and control of Serial-over-LAN (SOL)
You can click on a class name above, to see documentation for the available methods.
In-Depth¶
As well as the above, the AMTDevice class provides more genearlized/low-level functionality.
-
class
wry.AMTDevice(target=None, is_ssl=True, username=None, password=None, debug=False, showxml=False)[source]¶ A wrapper class which packages AMT functionality into an accessible, device-centric format.
-
class
wry.AMTPower(device)[source]¶ Control over a device’s power state.
-
state¶ A property which describes the machine’s power state.
A
wry.device.StateMapas described inwry.device.AMT_POWER_STATE_MAP.
-
-
class
wry.AMTKVM(device)[source]¶ Control over a device’s KVM (VNC) functionality.
-
default_screen¶ Default Screen. An integer.
-
enabled¶ Whether KVM functionality is enabled or disabled.
True/False
Note
This will return True even if KVM is enabled, but no ports for it are.
-
enabled_ports¶ Tells you (and/or allows you to set) the enabled ports for VNC.
-
opt_in_timeout¶ User opt-in timeout for KVM access, in seconds.
If set to 0, opt-in will be disabled.
-
password¶ This doesn’t fail but always appears to return None
-
port_5900_enabled¶ Whether the standard VNC port (5900) is enabled. True/False.
-
session_timeout¶ Session timeout. In minutes.
-
-
class
wry.AMTBoot(device)[source]¶ Control how the machine will boot next time.
-
config¶ Get configuration for the machine’s next boot.
-
supported_media¶ Media the device can be configured to boot from.
-
-
wry.AMTOptIn¶ alias of
wry.AMTOptIn