mnc_python class API

class mnc.mcs.Client(id=None, timeout=5.0)[source]

MCS framework client. This can be used for both monitor and control.

cancel_command_callback(command)[source]

Cancel command processing setup with set_command_callback(). Return True if successful, False otherwise.

cancel_monitor_point_branch_callback(name, id=None)[source]

Cancel watching a monitoring point branch setup with set_monitor_point_branch_callback(). Return True if successful, False otherwise.

cancel_monitor_point_callback(name, id=None)[source]

Cancel watching a monitoring point setup with set_monitor_point_callback Return True if successful, False otherwise.

list_commands(subsystem)[source]

Return the contents of the command manifest for the specified subsystem. Returns the list if successful, None otherwise.

list_monitor_points(id=None)[source]

Return the contents of the monitoring point manifest. An ‘id’ of ‘None’ is interpretted as that monitoring point on the current subsystem. Returns the list if successful, None otherwise.

read_monitor_point(name, id=None)[source]

Read the current value of a monitoring point. An ‘id’ of ‘None’ is interpretted as that monitoring point on the current subsystem. Returns the monitoring point as a MonitorPoint if successful, None otherwise.

read_monitor_point_branch(name, id=None)[source]

Read the current value of all keys in a monitoring point branch. An ‘id’ of ‘None’ is interpretted as that monitoring point branch on the current subsystem. Returns the monitoring point branch as a list of two-element tuples of (key, MonitorPoint) if successful, None otherwise.

remove_monitor_point(name)[source]

Remove the specified monitoring point. Returns True if the deletion was successful, False otherwise.

send_command(subsystem, command, **kwargs)[source]

Send a command to the given subsystem and wait for a response. The arguments for the command are given as keywords. If a response is received within the timeout window, that response is returned as a two- element tuple of (True, the response as a dictionary). If a response was not received within the timeout window or another error occurred, return a two-element tuple of (False, sequence_id).

set_command_callback(command, callback)[source]

Process a command by executing the callback when it is received. The callback should be a sub-class of CommandCallbackBase. Return True is successful, False otherwise. This watch…callback behavior continues until the appropriate cancel_command_callback() is called.

set_monitor_point_branch_callback(name, callback, id=None)[source]

Watch the specified monitoring point branch and execute the callback when any key within that branch is updated. The callback should be a sub-class of MonitorPointCallbackBase. An ‘id’ of ‘None’ is interpretted as that monitoring point branch on the current subsystem. Return True is successful, False otherwise. This watch…callback behavior continues until the appropriate cancel_monitor_point_branch_callback() is called.

set_monitor_point_callback(name, callback, id=None)[source]

Watch the specified monitoring point and execute the callback when its value is updated. The callback should be a sub-class of MonitorPointCallbackBase. An ‘id’ of ‘None’ is interpretted as that monitoring point on the current subsystem. Return True is successful, False otherwise. This watch…callback behavior continues until the appropriate cancel_monitor_point_callback() is called.

write_monitor_point(name, value, timestamp=None, unit='')[source]

Write a value to the specified monitoring point. Returns True if the write was successful, False otherwise.