System Script python reference¶
Main interface function wrapped with lmi command is:
It accepts ns object as the first argument, an instance of lmi.shell.LMINamespace.
System Module API¶
LMI system client library.
- lmi.scripts.system.format_memory_size(size)¶
Returns formatted memory size.
Parameters: size (Number) – Size in bytes Returns: Formatted size string. Return type: String
- lmi.scripts.system.get_all_instances(ns, class_name)¶
Returns all instances of instance_name.
Parameters: instance_name (String) – Instance name Returns: List of instances of instance_name Return type: List of lmi.shell.LMIInstance
- lmi.scripts.system.get_colored_string(msg, color)¶
Returns colored message with ANSI escape sequences for terminal.
Parameters: - msg (String) – Message to be colored.
- color (Integer) – Color of the message [GREEN_COLOR, YELLOW_COLOR, RED_COLOR].
Returns: Colored message.
Return type: String
- lmi.scripts.system.get_hostname(ns)¶
Returns: System hostname. Return type: String
- lmi.scripts.system.get_hwinfo(ns)¶
Prints tabular data of system hw info.
- lmi.scripts.system.get_langinfo(ns)¶
Prints tabular data of language and time zone info.
- lmi.scripts.system.get_networkinfo(ns)¶
Prints tabular data of networking status.
- lmi.scripts.system.get_osinfo(ns)¶
Prints tabular data of system OS info.
- lmi.scripts.system.get_selinuxinfo(ns)¶
Prints tabular data of SELinux info.
- lmi.scripts.system.get_servicesinfo(ns)¶
Prints tabular data of some system services.
- lmi.scripts.system.get_single_instance(ns, class_name)¶
Returns single instance of instance_name.
Parameters: instance_name (String) – Instance name Returns: Instance of instance_name Return type: lmi.shell.LMIInstance
- lmi.scripts.system.get_storageinfo(ns)¶
Prints tabular data of storage info.
- lmi.scripts.system.get_system_info(ns)¶
Prints tabular data of all general system information.