This section explains the queue list information acquisition API/EE (Mp_ListQueue_Ex).
Synopsis
#include "f3cuapi.h" long Mp_ListQueue_Ex (char *rhost, long mode, struct Mp_QUEUEINF_1 *queueinf[ ], int system_num)
Description
This API obtains the list of queue information in Systemwalker Operation Manager EE.
Parameters
rhost
Specify NULL here.
mode
Specify one of the following process modes. After GETQST, you must always specify FREEQST.
Obtains the queue list information.
Frees the area that was used for the queue list information obtained by GETQST.
queueinf[ ]
Specify the address to which the address of the queue information structure (Mp_QUEUEINF_1).
Specify the area address to which the address of the job information structure's array was notified in GETQST. Between the issuing GETQST and FREEQST, you should not change the contents of the area.
system_num
Specifies operating target subsystem number using a range of 0 to 9.
Return Values
Return Value | Meaning | Action |
---|---|---|
1 or greater | This indicates that the queue information list was obtained normally and the number of queues is returned. | - |
-1 | A system error occurred. | Collect "Job Execution Control" information with the maintenance information collection tool and contact a Fujitsu SE. |
-1000 or less | Processing was aborted because an error was detected in Job Execution Control. Error messages can be obtained using the error message acquisition API. | Use the error message acquisition API to obtain the error message and take whatever action is required. |
Caution
When the argument is pointing to an invalid address, this function ends abnormally, and no operations will be defined.
Format of the Queue Information Structure (Mp_QUEUEINF_1)
The following is the format of the queue information structure.
This structure is defined in the INCLUDE file"f3cuapi.h".
typedef struct _Mp_QUEUEINF_1 { char queuename[]; /*queue name */ long queuetype; /*queue type */ char status; /*queue status */ long maxjob; /*maximum possible job submission quantity */ long maxexec; /*maximum possible job execution quantity */ long elapsed; /*maximum time lapse limit (seconds) */ long dfltprty; /*default priority order */ long dfltdprty; /*default priority */ long job_wait; /*jobs waiting to be executed */ long job_hold; /*jobs on hold */ long job_run; /*jobs in execution */ char hostgrp[]; /*distributed host group name */ } Mp_QUEUEINF_1
Following provides the explanations about each item.
The queue name is set.
The queue type is set. The following types can be set for a queue:
Value | Type |
---|---|
1 | Local queue |
2 | Distributed execution queue |
The queue status is set. The following statuses can be set for a queue:
Value | Status |
---|---|
1 | Operating |
2 | Paused |
The maximum number of possible jobs to be submitted is set.
The maximum number of possible jobs to be executed is set.
The maximum time lapse limit is set in seconds.
The default priority order is set.
The default priority is set.
The number of jobs waiting to be executed at the moment when the API was called up is set.
The number of jobs held at the moment when the API was called is set.
The number of jobs being executed at the moment when the API was called is set.
The distributed host group name is set. NULL is set when it is a local queue.
Program Example
Below is an example program of the queue list information acquisition API/EE:
#include <windows.h> #include <stdio.h> #include "f3cuapi.h" int main (int argc, char **argv) { Mp_QUEUEINF_1 *queinf = 0; Mp_QUEUEINF_1 *qinf = 0; int system_num; long mode; long idx; long rtn = 0; char errmsg[256+1]; /* * initialization working area */ memset(errmsg, 0x00, sizeof(errmsg)); mode = GETQST; /* * call Mp_ListQueue_Ex() API */ system_num = 0; rtn = Mp_ListQueue_Ex (NULL, mode, &queinf, system_num); /* * check return code of Mp_ListQueue_Ex() API */ if (rtn == -1){ printf ("GetLastError() is %d.\n", GetLastError()); return (1); } else if (rtn <= -1000) { printf ("Error code is %d.\n", rtn); Mp_GetMJESerror (errmsg); printf ("errmsg = %s\n", errmsg); return (1); } qinf = queinf; printf("queue name wait hold run status\n"); for (idx = 0; idx < rtn; idx++) { printf("%15.15s %5.5d %5.5d %5.5d ", qinf->queuename, qinf->job_wait, qinf->job_hold, qinf->job_run); switch(qinf->status){ case 1 : printf("active "); break; case 0 : default : printf("inactive"); break; } printf("\n"); qinf++; } mode = FREEQST; /* * call Mp_ListQueue_Ex() API */ Mp_ListQueue_Ex (NULL, mode, &queinf, system_num); return(0); }