pbs_statrsc.3B 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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_statrsc 3B "3 March 2015" Local "PBS Professional"
  37. .SH NAME
  38. pbs_statrsc - obtain status of PBS resources
  39. .SH SYNOPSIS
  40. #include <pbs_error.h>
  41. .br
  42. #include <pbs_ifl.h>
  43. .sp
  44. .B struct batch_status *pbs_statrsc(\^int\ connect, char\ *name,
  45. .B struct\ attrl\ *attrib, char *extend)
  46. .sp
  47. .B void pbs_statfree(\^struct batch_status *psj\^)
  48. .sp
  49. .SH DESCRIPTION
  50. Issue a batch request to query and return the status of a specified
  51. resource, or a set of resources at a server.
  52. .LP
  53. A
  54. .I "Status Resource"
  55. batch request is generated and sent to the server over the connection
  56. specified by
  57. .I connect.
  58. .LP
  59. .SH PARAMETERS
  60. The
  61. .I connect
  62. parameter is the file descriptor which is the connection to a PBS
  63. server, and is the return value of
  64. .B pbs_connect().
  65. The
  66. .I name
  67. parameter is the name of the resource to query. To query all resources
  68. at the server, pass NULL as the name.
  69. .LP
  70. The
  71. .I attrib
  72. parameter is a pointer to a list of attributes to query.
  73. If
  74. .I attrib
  75. is specified, then only the attributes in the list are returned by the server.
  76. Otherwise, all the attributes of a resource are returned.
  77. The
  78. .I attrib
  79. parameter is a pointer to an
  80. .I attrl
  81. structure which is defined in pbs_ifl.h as:
  82. .sp
  83. .Ty
  84. .nf
  85. struct attrl {
  86. struct attrl *next;
  87. char *name;
  88. char *resource;
  89. char *value;
  90. };
  91. .fi
  92. .sp
  93. .RS 4
  94. The
  95. .I next
  96. member is a pointer to the next entry in the list.
  97. The
  98. .I attrib
  99. list is terminated by the first entry where
  100. .I next
  101. is a null pointer.
  102. The
  103. .I name
  104. member is a pointer to an attribute name. Attribute names are
  105. listed in pbs_ifl.h.
  106. The
  107. .I resource
  108. member is unused.
  109. The
  110. .I value
  111. member should always be a pointer to a null string.
  112. .LP
  113. .RE
  114. The
  115. .I extend
  116. parameter is unused.
  117. .SH RETURN VALUES and ERRORS
  118. For a single resource, if the resource can be queried, the return value is a pointer to a
  119. .I batch_status
  120. structure containing the status of the specified resource.
  121. If the resource cannot be queried, a NULL pointer is returned, and
  122. .I pbs_errno
  123. is set to an error number.
  124. When querying a server, the connection to the server is already
  125. established by
  126. .B pbs_connect().
  127. If there are resources at the server, the return value of the query is a
  128. pointer to a
  129. .I batch_status
  130. structure containing the status of all the queryable resources at the
  131. server.
  132. In the unlikely event that the server does not contain any
  133. queryable resources because the issuer is unprivileged and all resources
  134. have the i (invisible) flag set, a NULL pointer ia returned and
  135. .I pbs_errno
  136. is set to PBSE_NONE (0).
  137. The batch_status structure is defined in pbs_ifl.h as
  138. .sp
  139. .Ty
  140. .nf
  141. struct batch_status {
  142. struct batch_status *next;
  143. char *name;
  144. struct attrl *attribs;
  145. char *text;
  146. }
  147. .fi
  148. .LP
  149. It is up the user to free the structure when no longer needed, by calling
  150. \f3pbs_statfree\f1().
  151. .LP
  152. .SH SEE ALSO
  153. qstat(1B) and pbs_connect(3B)