pbs_stathook.3B 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. .\" Copyright (C) 1994-2018 Altair Engineering, Inc.
  2. .\" For more information, contact Altair at www.altair.com.
  3. .\"
  4. .\" This file is part of the PBS Professional ("PBS Pro") software.
  5. .\"
  6. .\" Open Source License Information:
  7. .\"
  8. .\" PBS Pro is free software. You can redistribute it and/or modify it under the
  9. .\" terms of the GNU Affero General Public License as published by the Free
  10. .\" Software Foundation, either version 3 of the License, or (at your option) any
  11. .\" later version.
  12. .\"
  13. .\" PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
  14. .\" WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  15. .\" FOR A PARTICULAR PURPOSE.
  16. .\" See the GNU Affero General Public License for more details.
  17. .\"
  18. .\" You should have received a copy of the GNU Affero General Public License
  19. .\" along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. .\"
  21. .\" Commercial License Information:
  22. .\"
  23. .\" For a copy of the commercial license terms and conditions,
  24. .\" go to: (http://www.pbspro.com/UserArea/agreement.html)
  25. .\" or contact the Altair Legal Department.
  26. .\"
  27. .\" Altair’s dual-license business model allows companies, individuals, and
  28. .\" organizations to create proprietary derivative works of PBS Pro and
  29. .\" distribute them - whether embedded or bundled with other software -
  30. .\" under a commercial license agreement.
  31. .\"
  32. .\" Use of Altair’s trademarks, including but not limited to "PBS™",
  33. .\" "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
  34. .\" trademark licensing policies.
  35. .\"
  36. .TH pbs_stathook 3B "13 Sept 2011" Local "PBS Professional"
  37. .SH NAME
  38. pbs_stathook - obtain status information about PBS site hooks
  39. .SH SYNOPSIS
  40. #include <pbs_error.h>
  41. .br
  42. #include <pbs_ifl.h>
  43. .sp
  44. .B struct batch_status *pbs_stathook(\^int\ connect, char\ *id,
  45. .B struct\ attrl\ *attrib, char *extend)
  46. .sp
  47. .B void pbs_statfree(\^struct batch_status *psj\^)
  48. .SH DESCRIPTION
  49. Issue a batch request to obtain the status of a specified site hook or
  50. a set of site hooks at the current server.
  51. .LP
  52. A
  53. .I "Status Hook"
  54. batch request is generated and sent to the server over the connection
  55. specified by
  56. .I connect
  57. which is the return value of \f3pbs_connect\f1().
  58. .LP
  59. This API can be executed only by root on the local server host.
  60. .LP
  61. The parameter,
  62. .I id ,
  63. may be either a hook name or the null string.
  64. If
  65. .I id
  66. specifies a name, the attribute-value list for that hook is
  67. returned.
  68. If
  69. .I id
  70. is a null string or a null pointer, the status of all
  71. hooks at the current server is returned.
  72. The parameter,
  73. .I attrib ,
  74. is a pointer to an
  75. .I attrl
  76. structure which is defined in pbs_ifl.h as:
  77. .sp
  78. .Ty
  79. .nf
  80. struct attrl {
  81. struct attrl *next;
  82. char *name;
  83. char *resource;
  84. char *value;
  85. };
  86. .fi
  87. .sp
  88. The
  89. .I attrib
  90. list is terminated by the first entry where
  91. .I next
  92. is a null pointer.
  93. If an
  94. .I attrib
  95. list is given, then only the attributes in the list are returned by the server.
  96. Otherwise, all the attributes of a hook are returned.
  97. The
  98. .I resource
  99. member is only used if the
  100. .I name
  101. member is ATTR_l, otherwise it should be a
  102. pointer to a null string.
  103. The
  104. .I value
  105. member should always be a pointer to a null string.
  106. .LP
  107. The parameter,
  108. .I extend ,
  109. is reserved for implementation-defined extensions.
  110. .LP
  111. The return value
  112. is a pointer to a list of
  113. .I batch_status
  114. structures or the null pointer if no site hooks can be queried for status.
  115. The batch_status structure is defined in pbs_ifl.h as
  116. .sp
  117. .Ty
  118. .nf
  119. struct batch_status {
  120. struct batch_status *next;
  121. char *name;
  122. struct attrl *attribs;
  123. char *text;
  124. }
  125. .fi
  126. .LP
  127. It is up the user to free the structure when no longer needed, by calling
  128. \f3pbs_statfree\f1().
  129. .LP
  130. .SH "SEE ALSO"
  131. pbs_hook_attributes(7B),
  132. pbs_connect(3B)
  133. .SH DIAGNOSTICS
  134. When the batch request generated by the
  135. .B pbs_stathook()
  136. function has been completed successfully and the status of each site hook
  137. has been returned by the batch server, the routine will return a pointer to
  138. the list of batch_status structures.
  139. If no site hooks were available to query or an error occurred, a null
  140. pointer is returned. The global integer
  141. .I pbs_errno
  142. should be examined to determine the cause.