GLOBUS_NET_MANAGER_PYTHON(3)

πŸ“¦
version 1.7 Β· 6 versions
, in fedora 43, fedora 44, ubuntu resolute, ubuntu stonking

✨ NAME ✨

globus_net_manager_python β€” the Python Module πŸ’– (yes bestie, it's literally the Net Manager Python Module, that's the whole vibe)


🌈 SYNOPSIS 🌈

okay so welcome to the Net Manager Python Module 🫢 β€” this is an example module that hands you basic Python language bindings to the Network Manager callout functionality. No cap.


πŸ¦‹ DETAILED DESCRIPTION πŸ¦‹

So here's the tea β˜•: this module is an example, and to actually use it you define a Python module that implements some subset of the following functions:

def pre_listen(task_id, transport, attrs):
    # return list of (scope, name, value) tuples or None
def post_listen(task_id, transport, local_contact, attrs):
    # return a tuple containing (local_contact_out, [(scope, name, value),...])
def end_listen(task_id, transport, local_contact, attrs):
    # return a list of (scope, name, value) tuples or None
def pre_accept(task_id, transport, local_contact, attrs):
    # return list of (scope, name, value) tuples or None
def post_accept(task_id, transport, local_contact, remote_contact, attrs):
    # return list of (scope, name, value) tuples or None
def pre_connect(task_id, transport, remote_contact, attrs):
    # return a tuple containing (remote_contact_out, [(scope, name, value),...])
def post_connect(task_id, transport, local_contact, remote_contact, attrs):
    # return list of (scope, name, value) tuples or None
def pre_close(task_id, transport, local_contact, remote_contact, attrs):
    # return None
def post_close(task_id, transport, local_contact, remote_contact, attrs):
    # return None

✨ Little type check moment ✨ β€” the task_id, transport, local_contact, and remote_contact parameters to these functions are all string objects. And the attrs parameter? That one's a list of 3-tuples (scope, name, value). That's it, that's the shape πŸ’…


πŸŽ€ Using it with the GridFTP server

Want this running with the GridFTP server? Add a file containing the following to the GridFTP configuration directory /etc/gridftp.d:

$PYTHONPATH PATH
xnetmgr "manager=python;pymod=MODULE_NAME;"

Where 'PATH' is the directory containing your module and 'MODULE_NAME' is the name of the python module that you would use to import it (i.e. without the .py extension, bestie, don't @ me). So a module /usr/local/globus/routeman.py would require:

$PYTHONPATH /usr/local/globus
xnetmgr "manager=python;pymod=routeman;"

🧚 Using it with the XIO module directly

If you're going straight to the XIO module, set the string options:

manager=python;pymod=routeman;
heads up bestie β€” you'll need to set the PYTHONPATH environment variable elsewhere. It's giving "figure it out yourself" energy, but that's just how it is πŸ™ˆ

πŸ’œ Configuring the network manager directly (no XIO)

To configure the network manager to use this module directly without XIO, set the "pymod" attribute in the "python" scope to the name of the python module to import and use. For example:

globus_net_manager_attr_init(
    &attr,
    "python",
    "pymod",
    "routeman");

...and pass this to the context functions. slay ✨


πŸ‘‘ AUTHOR πŸ‘‘

Generated automatically by Doxygen for globus_net_manager from the source code. iconic behaviour, honestly 🌸


that's the whole page, bestie β€” globus_net_manager Version 1.7, from the globus_net_manager library functions manual. go forth and configure ur network manager πŸ’…πŸ¦‹πŸ’–

πŸ“¦ where this page comes from