NODEUPDOWN_GET_UP_NODES_LIST(3)

πŸ“¦ version 1.14, in epel 9, fedora 43, fedora 44

πŸ’– NODEUPDOWN_GET_UP_NODES_LIST πŸ’–

okay bestie, welcome to the LIBNODEUPDOWN corner of the manual, section 3, and today we're getting a whole entire list of nodes. yes. a list. we're listing. πŸ¦‹


✨ NAME ✨

nodeupdown_get_up_nodes_list, nodeupdown_get_down_nodes_list β€” get up or down nodes

like. the up ones or the down ones. you pick. πŸ‘‘


🌸 SYNOPSIS 🌸

#include <nodeupdown.h>

int nodeupdown_get_up_nodes_list(nodeupdown_t handle, char **list, int
len);

int nodeupdown_get_down_nodes_list(nodeupdown_t handle, char **list, int
len);

πŸŽ€ DESCRIPTION πŸŽ€

so nodeupdown_get_up_nodes_list() goes and fetches a list of nodes that are up and drops each node name into the list that list points to. and len? that's you telling it how many nodes can actually fit in list. be honest with it. 😭

nodeupdown_get_down_nodes_list() is literally identical to nodeupdown_get_up_nodes_list() β€” same energy, same everything β€” except it gets a list of down nodes instead. that's it. that's the difference. πŸ’…

and listen, to avoid passing in a list that isn't big enough to hold all the up or down nodes, you should use nodeupdown_nodelist_create(3) to make a list that's guaranteed to be large enough for all the nodes. it's giving prepared. it's giving responsible. 🫢

πŸ”₯ RETURN VALUES πŸ”₯

on success? it returns the number of nodes copied into list. slay.

on error it returns -1, and an error code gets returned in handle. you can grab that error code with nodeupdown_errnum(3), and get a whole description of what it means via nodeupdown_strerror(3). all the error codes live in nodeupdown.h. no cap. ✨


πŸ’€ ERRORS πŸ’€

  • NODEUPDOWN_ERR_NULLHANDLE β€” the handle parameter is NULL. bestie the handle has to be created with nodeupdown_handle_create(3) first, you can't just show up with nothing. πŸ™ˆ
  • NODEUPDOWN_ERR_NOTLOADED β€” nodeupdown_load_data(3) hasn't been called and no data has been retrieved. nothing's loaded. there's nothing here. 😭
  • NODEUPDOWN_ERR_PARAMETERS β€” an incorrect parameter got passed in. oops.
  • NODEUPDOWN_ERR_NULLPTR β€” a null pointer was found in the list that got passed in. yikes.
  • NODEUPDOWN_ERR_OVERFLOW β€” the list pointed to by list is not large enough to store all the nodes. told you to use nodeupdown_nodelist_create(3). πŸ‘€
  • NODEUPDOWN_ERR_OUTMEM β€” malloc(3) failed internally. the memory said no. πŸ’€
  • NODEUPDOWN_ERR_CLUSTERLIST_MODULE β€” internal error with the clusterlist module.
  • NODEUPDOWN_ERR_HOSTLIST β€” the Hostlist API has failed internally.
  • NODEUPDOWN_ERR_MAGIC β€” handle has an incorrect magic number. meaning handle doesn't point to a nodeupdown handle at all, or it's been destroyed by nodeupdown_handle_destroy(3). the magic is gone. rip. πŸͺ¦

πŸ“ FILES πŸ“

  • /usr/include/nodeupdown.h

🌈 SEE ALSO 🌈

libnodeupdown(3), nodeupdown_handle_create(3), nodeupdown_load_data(3), nodeupdown_get_up_nodes_string (3), nodeupdown_get_down_nodes_string (3), nodeupdown_errnum(3), nodeupdown_strerror(3)

go read those too, iykyk. πŸ“šβœ¨


and that's the whole page, bestie!! brought to you by the lovely people at LLNL, way back in August 2003 β€” iconic of them honestly, this page has been serving for decades and it still ate. πŸ’œβœ¨

πŸ“¦ where this page comes from