#: Same as :meth:`connect_ssh`
connect = connect_ssh
+OPERATIONS = {
+ "get": operations.Get,
+ "get_config": operations.GetConfig,
+ "edit_config": operations.EditConfig,
+ "copy_config": operations.CopyConfig,
+ "validate": operations.Validate,
+ "commit": operations.Commit,
+ "discard_changes": operations.DiscardChanges,
+ "delete_config": operations.DeleteConfig,
+ "lock": operations.Lock,
+ "unlock": operations.Unlock,
+ "close_session": operations.CloseSession,
+ "kill_session": operations.KillSession,
+ "poweroff_machine": operations.PoweroffMachine,
+ "reboot_machine": operations.RebootMachine
+}
+
class Manager(object):
"""API for NETCONF operations.
return False
def __getattr__(self, name):
- op = operations.INDEX.get(name, None)
+ op = OPERATIONS.get(name, None)
if op is None:
raise AttributeError
else:
# others...
from flowmon import PoweroffMachine, RebootMachine
-INDEX = {
- 'get': Get,
- 'get_config': GetConfig,
- 'edit_config': EditConfig,
- 'copy_config': CopyConfig,
- 'validate': Validate,
- 'commit': Commit,
- 'discard_changes': DiscardChanges,
- 'delete_config': DeleteConfig,
- 'lock': Lock,
- 'unlock': Unlock,
- 'close_session': CloseSession,
- 'kill_session': KillSession,
- 'poweroff_machine': PoweroffMachine,
- 'reboot_machine': RebootMachine
-}
-
__all__ = [
'RPC',
'RPCReply',
'RPCError',
- 'OPERATIONS',
'Get',
'GetConfig',
'GetReply',