Top
Systemwalker Operation Manager  Reference Guide
FUJITSU Software

16.2.5 Group Manipulation API

This section explains the group manipulation API (Mp_JobschCtlGrp).

Synopsis

[Windows]

#include "f3csbJobschControl.h"
int Mp_JobschCtlGrp (char *project, 
             char *grpname,
             int action) ;

[UNIX]

#include "jobschapi.h"
int Mp_JobschCtlGrp (char *project,
             char *grpname,
             int action) ;

Description

This API is an interface to use the jobschctlgrp command from the C interface.

Parameters

project

Specify the name of the project where the group to be manipulated exists. Note that you can only specify the project names that the API execution user can use.

This can be omitted if there is only one project having the group that the API execution user can use. In this case, NULL must be specified.

grpname

Specify the name of a group to be manipulated. This cannot be omitted.

action

Specify a job group manipulation method from the following:

1:

Start

2:

Cancel

3:

Restart

4:

Pause

5:

Continue

6:

Disable

7:

Enable

8:

Confirm

Return Values

Return Value

Meaning

Action

0

Normal termination.

-

4

No job group can be manipulated.

Perform the operation again after the status of the group has changed.

8

Jobscheduler service/daemon is not running.

Start the Jobsheduler service or daemon and perform the operation again.

12

Error in parameter setting or invalid user privilege.

Take one of the following measures:

  • Set the correct parameter (project name, group name or operation method).

  • Grant the executing user access privileges to operate the project or higher privileges.

16

Fatal error occurred.

A system error may have occurred. Check the event log or syslog for any system abnormalities. If an error occurs, collect Jobscheduler information using the Maintenance Information Collection Tool, and then contact a Fujitsu SE. If none are found, the problem may only have been temporary, so perform the operation again.

Required Files

The following files are required for use with the group manipulation API shown above:

[Windows x86]

LIB:

f3csbJobschCtlGrp.lib

INCLUDE:

f3csbJobschControl.h

[Windows x64]

LIB:

f3csbJobschCtlGrp_x64.lib

INCLUDE:

f3csbJobschControl_x64.h

[Common to Solaris 32-bit and Linux x86]

LIB:

libjobsch.so

INCLUDE:

jobschapi.h

[Solaris 64-bit]

LIB:

libjobsch_64.so

INCLUDE:

jobschapi_64.h

[Linux x64]

LIB:

libjobsch_x64.so

INCLUDE:

jobschapi_x64.h

The group manipulation API is stored in the LIB file, and the definitions and structures used by this API are declared in the INCLUDE file.

These files are stored under the following directory:

[Windows]

LIB:

Systemwalker Operation Manager installation directory
MpWalker.JM\lib

INCLUDE:

Systemwalker Operation Manager installation directory
MpWalker.JM\include

[Common to Solaris and Linux]

LIB:

/opt/FJSVJOBSC/usr/lib

INCLUDE:

/opt/FJSVJOBSC/usr/include

Program Example

Below is an example program of the group manipulation API:

[Windows]

#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include "f3csbJobschControl.h" 

void main()
{
    int ret;

    ret = Mp_JobschCtlGrp("user1",        // project name
                          "grp001",       // group name
                          1);             // action : start
    if (ret == 0) {
        printf("group(grp001) is controlled normally.\n"); 
    }
    else{
        printf("ERROR: return code = %d\n", ret); 
        exit(1);
    }
    exit(0);
}

[UNIX]

#include <stdio.h>
#include <stdlib.h>
#include "jobschapi.h"

main()
{
    int ret;

    ret = Mp_JobschCtlGrp("user1",        /* project name*/
                          "grp001",       /* group name */
                          1);             /* action : start */

    if (ret == 0) {
        printf("group(grp001) was normally controlled.\n");
    }
    else{
        printf("ERROR: return code = %d\n", ret);
        exit(1);
    }
    exit(0);
}