Libnodeupdown(3)

πŸ“¦
version 1.14 Β· 3 versions
, in epel 9

πŸ’– NAME πŸ’–

okay so this is Libnodeupdown β€” it's the Perl extension for libnodeupdown, and yes bestie you are literally reading the Libnodeupdown(3) page right now 🫢


✨ SYNOPSIS ✨

here's the whole vibe, copy-paste ready πŸ‘‡

use Libnodeupdown;

Libnodeupdown::NODEUPDOWN_ERR_SUCCESS
Libnodeupdown::NODEUPDOWN_ERR_NULLHANDLE
Libnodeupdown::NODEUPDOWN_ERR_CONNECT
Libnodeupdown::NODEUPDOWN_ERR_CONNECT_TIMEOUT
Libnodeupdown::NODEUPDOWN_ERR_HOSTNAME
Libnodeupdown::NODEUPDOWN_ERR_ISLOADED
Libnodeupdown::NODEUPDOWN_ERR_NOTLOADED
Libnodeupdown::NODEUPDOWN_ERR_OVERFLOW
Libnodeupdown::NODEUPDOWN_ERR_PARAMETERS
Libnodeupdown::NODEUPDOWN_ERR_NULLPTR
Libnodeupdown::NODEUPDOWN_ERR_OUTMEM
Libnodeupdown::NODEUPDOWN_ERR_NOTFOUND
Libnodeupdown::NODEUPDOWN_ERR_BACKEND_MODULE
Libnodeupdown::NODEUPDOWN_ERR_CLUSTERLIST_MODULE
Libnodeupdown::NODEUPDOWN_ERR_CONFIG_MODULE
Libnodeupdown::NODEUPDOWN_ERR_CONF_PARSE
Libnodeupdown::NODEUPDOWN_ERR_CONF_INPUT
Libnodeupdown::NODEUPDOWN_ERR_CONF_INTERNAL
Libnodeupdown::NODEUPDOWN_ERR_MAGIC
Libnodeupdown::NODEUPDOWN_ERR_INTERNAL
Libnodeupdown::NODEUPDOWN_ERR_ERRNUMRANGE

$handle = Libnodeupdown->nodeupdown_handle_create();

$handle->nodeupdown_load_data();
$handle->nodeupdown_load_data($hostname,
                              $port,
                              $timeout_len,
                              $reserved);

$handle->nodeupdown_errnum()
$handle->nodeupdown_strerror($errnum)
$handle->nodeupdown_errormsg()
$handle->nodeupdown_perror($msg)

$handle->nodeupdown_get_up_nodes_string();
$handle->nodeupdown_get_down_nodes_string();

$handle->nodeupdown_get_up_nodes_list();
$handle->nodeupdown_get_down_nodes_list();

$handle->nodeupdown_is_node_up($node);
$handle->nodeupdown_is_node_down($node);

$handle->nodeupdown_up_count();
$handle->nodeupdown_down_count();

🌸 DESCRIPTION 🌸

so this package hands you an OO Perl interface to the nodeupdown C API (peep libnodeupdown(3) for that one). The Perl side is similar to the C nodeupdown API β€” key word similar, because there are some necessary changes since C and Perl are, like, fundamentally different creatures 😭. Read the instructions below so you actually know how to use the Libnodeupdown package, bestie. No skipping πŸ’…

πŸŽ€ Initialization

  • Libnodeupdown->nodeupdown_handle_create β€” returns a nodeupdown object when it slays ✨, and undef on error.
  • $handle->nodeupdown_load_data()
  • $handle->nodeupdown_load_data($hostname, $port, $timeout_len, $reserved) β€” loads the data that the rest of the nodeupdown library is gonna use. Want defaults? Pass in undef for any of those parameters. Want all the defaults? Just call nodeupdown_load_data with no parameters at all, iconic. Returns 0 on success, -1 on error.

😭 Error Messages 😭

same energy as the C API: an error code gets stored in the nodeupdown object the moment an error happens. These are the ones you call to grab that error code and get the info out πŸ‘‡

  • $handle->nodeupdown_errnum() β€” returns the error code that was set most recently.
  • $handle->nodeupdown_strerror($errnum) β€” returns a string describing the error code $errnum.
  • $handle->nodeupdown_errormsg() β€” returns a string describing the most recent error.
  • $handle->nodeupdown_perror([$msg]) β€” spits out $msg plus a string describing the most recent error, both to standard error. If $msg isn't specified, only the description of the most recent error goes out to standard error.

πŸ¦‹ Data Functions πŸ¦‹

  • $handle->nodeupdown_get_up_nodes_string() β€” returns a ranged string of nodes that are up. Returns undef on error.
  • $handle->nodeupdown_get_down_nodes_string() β€” returns a ranged string of nodes that are down. Returns undef on error.
  • $handle->nodeupdown_get_up_nodes_list() β€” returns a list of nodes that are up. Returns undef on error.
  • $handle->nodeupdown_get_down_nodes_list() β€” returns a list of nodes that are up. Returns undef on error. πŸ™ˆ (bestie the page literally says "up" here β€” not me, I'm just the messenger, no cap.)
  • $handle->nodeupdown_is_node_up($node) β€” returns 1 if the specified node is up, 0 if it's not, -1 on error.
  • $handle->nodeupdown_is_node_down($node) β€” returns 1 if the specified node is down, 0 if it's not, -1 on error.
  • $handle->nodeupdown_up_count() β€” returns the number of up nodes, -1 on error.
  • $handle->nodeupdown_down_count() β€” returns the number of down nodes, -1 on error.

πŸ‘‘ Error Codes/Constants πŸ‘‘

the exact same error codes and constants that live in /usr/include/nodeupdown.h are accessible through these, periodt:

Libnodeupdown::NODEUPDOWN_ERR_SUCCESS
Libnodeupdown::NODEUPDOWN_ERR_NULLHANDLE
Libnodeupdown::NODEUPDOWN_ERR_CONNECT
Libnodeupdown::NODEUPDOWN_ERR_CONNECT_TIMEOUT
Libnodeupdown::NODEUPDOWN_ERR_HOSTNAME
Libnodeupdown::NODEUPDOWN_ERR_ISLOADED
Libnodeupdown::NODEUPDOWN_ERR_NOTLOADED
Libnodeupdown::NODEUPDOWN_ERR_OVERFLOW
Libnodeupdown::NODEUPDOWN_ERR_PARAMETERS
Libnodeupdown::NODEUPDOWN_ERR_NULLPTR
Libnodeupdown::NODEUPDOWN_ERR_OUTMEM
Libnodeupdown::NODEUPDOWN_ERR_NOTFOUND
Libnodeupdown::NODEUPDOWN_ERR_BACKEND_MODULE
Libnodeupdown::NODEUPDOWN_ERR_CLUSTERLIST_MODULE
Libnodeupdown::NODEUPDOWN_ERR_CONFIG_MODULE
Libnodeupdown::NODEUPDOWN_ERR_CONF_PARSE
Libnodeupdown::NODEUPDOWN_ERR_CONF_INPUT
Libnodeupdown::NODEUPDOWN_ERR_CONF_INTERNAL
Libnodeupdown::NODEUPDOWN_ERR_MAGIC
Libnodeupdown::NODEUPDOWN_ERR_INTERNAL
Libnodeupdown::NODEUPDOWN_ERR_ERRNUMRANGE

⭐ AUTHOR ⭐

shoutout to Albert Chu <chu11@llnl.gov> β€” the main character who made this happen πŸ‘‘

🌈 SEE ALSO 🌈

  • libnodeupdown β€” go read that one too, iykyk πŸ’œ

okay that's the whole page bestie, go forth and query nodes πŸŒΈπŸ’… β€” this little number was brought to you by perl v5.32.1, dated 2023-01-21, and it lives its life as Libnodeupdown(3) πŸŽ€βœ¨πŸ«Ά

πŸ“¦ where this page comes from