pbs_manager(3B)

NAME
pbs_manager - modifies a PBS batch object

SYNOPSIS
#include <pbs_error.h>
#include <pbs_ifl.h>

int pbs_manager(int connect, int command, int obj_type, char *obj_name, struct attropl *attrib, char *extend)

DESCRIPTION
Issue a batch request to perform administration functions at a server. With this request, server objects such as queues can be created and deleted, and have their attributes set and unset.

A Manage batch request is generated and sent to the server over the connection specified by connect which is the return value of pbs_connect(). This request requires full batch administrator privilege.

The parameter, command , specifies the operation to be performed. See pbs_ifl.h:

    MGR_CMD_CREATE creates the object
    MGR_CMD_DELETE deletes the object
    MGR_CMD_SET sets the value
    MGR_CMD_UNSET unsets the value
    MGR_CMD_IMPORT imports the hook
    MGR_CMD_EXPORT exports the hook

The parameter, obj_type , declares the type of object upon which the command operates. See pbs_ifl.h:

    MGR_OBJ_SERVER Server object
    MGR_OBJ_QUEUE Queue object
    MGR_OBJ_NODE Node object
    MGR_OBJ_HOOK Hook object

The parameter, obj_name , is the name of the specific object.

The parameter, attrib , is a pointer to an attropl structure which is defined in pbs_ifl.h as:

    struct attropl {
        char   *name;
        char   *resource;
        char   *value;
        enum batch_op op;
        struct attropl *next;
    };

The attrib list is terminated by the first entry where next is a null pointer.

The name member points to a string which is the name of the attribute.

If the attribute is one which contains a set of resources, the specific resource is specified in the structure member resource . Otherwise, the member resource is pointer to a null string.

The value member points to a string which is the new value of the attribute. For parameterized limit attributes, this string contains all parameters for the attribute.

The op member defines the manner in which the new value is assigned to the attribute. The operators are: enum batch_op { ..., SET, UNSET, INCR, DECR };

For MGR_CMD_IMPORT, specify attropl "name" as "content-type", "content-encoding", and "input-file" along with the corresponding "value" and an "op" of SET. For MGR_CMD_EXPORT, specify attropl "name" as "content-type", "content-encoding", and "output-file" along with the corresponding "value" and an "op" of SET. The parameter extend is reserved for implementation-defined extensions.

Privilege required for functions depends on whether those functions are used with hooks.
When not used with hooks:

    Functions MGR_CMD_CREATE and MGR_CMD_DELETE require PBS Manager privilege.
    Functions MGR_CMD_SET and MGR_CMD_UNSET require PBS Manager or Operator privilege.

When used with hooks:

    All commands require root privilege on the server host.

Functions MGR_CMD_IMPORT, MGR_CMD_EXPORT, and MGR_OBJ_HOOK are used only with hooks, and therefore require root privilege on the server host.

DIAGNOSTICS
When the batch request generated by pbs_manager() function has been completed successfully by a batch server, the routine will return 0 (zero). Otherwise, a non zero error is returned. The error number is also set in pbs_errno.

SEE ALSO
The PBS Professional Programmer's Guide,
qmgr(1B), pbs_connect(3B)