Service Command Reference


Table 1. STAF Service Command Reference
Command Syntax
DELAY Delay (or sleep) a number of milliseconds.

DELAY <milliseconds>
DIAG Allows diagnostics to be recorded, listed, enabled, disabled, and reset.

RECORD TRIGGER <Trigger> SOURCE <Source>
 
LIST   < [TRIGGER <Trigger> | SOURCE <Source> | TRIGGERS | SOURCES]
         [SORTBYCOUNT | SORTBYTRIGGER | SORTBYSOURCE] > |
       SETTINGS
       
RESET  FORCE
 
ENABLE
 
DISABLE
 
HELP
ECHO Echo a return string from other STAF clients.

ECHO <message>
FS Allows you to manipulate files and directories.

COPY   FILE <Name> [TOFILE <Name>] [TOMACHINE <Machine>]
       [TEXT [FORMAT <Format>]]
       [FAILIFEXISTS | FAILIFNEW]
 
COPY   DIRECTORY <Name> [TODIRECTORY <Name>]  [TOMACHINE <Machine>]
       [NAME <Pattern>]  [EXT <Pattern>] [CASESENSITIVE | CASEINSENSITIVE]
       [TEXTEXT <Pattern>... [FORMAT <Format>]]
       [RECURSE [KEEPEMPTYDIRECTORIES | ONLYDIRECTORIES]]
       [IGNOREERRORS] [FAILIFEXISTS | FAILIFNEW]
 
GET    FILE <Name> [[TEXT | BINARY] [FORMAT <Format>]]
 
GET    ENTRY <Name> <TYPE | SIZE | MODTIME>
 
QUERY  ENTRY <Name>
 
CREATE DIRECTORY <Name> [FULLPATH] [FAILIFEXISTS]
 
LIST   DIRECTORY <Name> [NAME <Pattern>] [EXT <Pattern>] [TYPE <Types>]
       [SORTBYNAME | SORTBYSIZE | SORTBYMODTIME]
       [CASESENSITIVE | CASEINSENSITIVE] [LONG [FORMAT]]
 
DELETE ENTRY <Name> [CHILDREN [NAME <Pattern>] [EXT <Pattern>] [TYPE <Types>]
       [CASESENSITIVE | CASEINSENSITIVE]] [RECURSE] [IGNOREERRORS] CONFIRM
 
HELP
HANDLE Query information on various process handles and manage static handles.

CREATE HANDLE NAME <Handle Name>
 
DELETE HANDLE <Number>
 
QUERY [ALL | NAME <Handle Name>] [PENDING] [REGISTERED] [INPROCESS] [STATIC]
 
HELP
HELP List and query STAF return codes. Allows services to register their own return codes.

REGISTER   SERVICE <Name> ERROR <Number> INFO <String> DESCRIPTION <String>
 
UNREGISTER SERVICE <Name> ERROR <Number>
 
[SERVICE <Name>] ERROR <Number>
 
LIST SERVICES | [SERVICE <Name>] ERRORS
 
HELP
LOG Allows for robust data-logging and log file querying and manipulation.

LOG    <GLOBAL | MACHINE | HANDLE> LOGNAME <Logname> LEVEL <Level>
       MESSAGE <Message> [RESOLVEMESSAGE | NORESOLVEMESSAGE]
 
QUERY  <GLOBAL | MACHINE <Machine> [HANDLE <Handle>] LOGNAME <Logname>
       [LEVELMASK <Mask>] [QMACHINE <Machine> [QHANDLE <Handle>]]
       [NAME <Name>] [FIRST <Num> | LAST <Num> | ALL] [TOTAL | STATS]
       [CONTAINS <String>]... [CSCONTAINS <String>]...
       [LEVELBITSTRING] [FIELDSEP <Char>]
       [FROM <Timestamp> | AFTER <Timestamp>]
       [BEFORE <Timestamp> | TO <Timestamp>]
 
LIST   GLOBAL | MACHINES | MACHINE <Machine> [HANDLE <Handle> | HANDLES] |
       SETTINGS
 
DELETE <GLOBAL | MACHINE <Machine> [HANDLE <Handle>]>
        LOGNAME <Logname> CONFIRM
 
PURGE  <GLOBAL | MACHINE <Machine> [HANDLE <Handle>]> LOGNAME <Logname>
       [LEVELMASK <Mask>] [QMACHINE <Machine>] [QHANDLE <Handle>]
       [NAME <Name>] [FIRST <Num> | LAST <Num>]
       [CONTAINS <String>]... [CSCONTAINS <String>]...
       [FROM <Timestamp> | AFTER <Timestamp>]
       [BEFORE <Timestamp> | TO <Timestamp>] CONFIRM
 
SET    [MAXRECORDSIZE <Size>] [DEFAULTMAXQUERYRECORDS <Number>]
       [OLDRETURNCODES | NEWRETURNCODES]
       [ENABLERESOLVEMESSAGEVAR | DISABLERESOLVEMESSAGEVAR]
       [RESOLVEMESSAGE | NORESOLVEMESSAGE]
 
VERSION
 
HELP
MISC Miscellaneous services such as VERSION, TRACE, and MACHINE information.

VERSION
 
MACHINE <Machine>
 
TRACE <ON | OFF> [ServiceRequest] [ServiceResult] [ServiceError]
                 [ServiceAccessDenied] [ServiceManagement]
                 [Registration] [RemoteRequests]
                 [Error] [Warning] [Info] [All]
 
TRACE [ALL] SERVICES [Service list]
 
TRACE TO <STDOUT | STDERR | FILE <Filename> >
 
TRACE LIST
 
HELP
MONITOR Allows test cases the ability to log and query status messages.

LOG    MESSAGE <Message> [RESOLVEMESSAGE | NORESOLVEMESSAGE]
 
QUERY  MACHINE <Machine> HANDLE <Handle>
 
LIST   <MACHINES | [MACHINE <Machine>&.rbrk. | SETTINGS>
 
DELETE [BEFORE <Timestamp>] CONFIRM
 
SET    [RESOLVEMESSAGE | NORESOLVEMESSAGE]
       [OLDRETURNCODES | NEWRETURNCODES] [MAXRECORDSIZE <Size>]
       [ENABLERESOLVEMESSAGEVAR | DISABLERESOLVEMESSAGEVAR]
 
VERSION
 
HELP
PING Allows you to ping other STAF clients.

PING
PROCESS Allows you to start, stop, and manage processes.

START [SHELL [<Shell>]] COMMAND <Command> [PARMS <Parms>] [WORKDIR <Directory>]
      [VAR <Variable>=<Value>] [ENV <Variable>=<Value>] [USEPROCESSVARS]
      [WORKLOAD <Name>] [TITLE <Title>] [WAIT [Timeout] | ASYNC]
      [STOPUSING <Method>] [NEWCONSOLE | SAMECONSOLE]
      [USERNAME <User name> [PASSWORD <Password>]]
      [DISABLEDAUTHISERROR | IGNOREDISABLEDAUTH] [STATICHANDLENAME <Name>]
      [STDIN <File>] [STDOUT <File> | STDOUTAPPEND <File>]
      [STDERR <File> | STDERRAPPEND <File> | STDERRTOSTDOUT]
      [RETURNSTDOUT] [RETURNSTDERR] [RETURNFILE <File>]...
      [NOTIFY ONEND [HANDLE <Handle> | NAME <Name>] 
      [MACHINE <Machine>] [PRIORITY <Priority>] [KEY <Key>]]
 
STOP  <ALL CONFIRM | WORKLOAD <Name> | HANDLE <Handle>> [USING <Method>]
 
QUERY <ALL | WORKLOAD <Name> | HANDLE <Handle>>
 
FREE  <ALL | WORKLOAD <Name> | HANDLE <Handle>>
 
NOTIFY REGISTER   ONENDOFHANDLE <Handle> [HANDLE <Handle> | NAME <Name>]
                  [MACHINE <Machine>] [PRIORITY <Priority>]
 
NOTIFY UNREGISTER ONENDOFHANDLE <Handle> [HANDLE <Handle> | NAME <Name>]
                  [MACHINE <Machine>] [PRIORITY <Priority>]
 
HELP
QUEUE Allows you to manipulate and manage queues.

QUEUE  [HANDLE <Handle>] | [NAME <Name>] [PRIORITY <Priority>]
       MESSAGE <Message>
 
GET    [PRIORITY <Priority>]... [MACHINE <Machine>]... [NAME <Name>]...
       [HANDLE <Handle>]...     [CONTAINS <String>]... [ICONTAINS <String>]...
       [WAIT [Timeout]]
 
PEEK   [PRIORITY <Priority>]... [MACHINE <Machine>]... [NAME <Name>]...
       [HANDLE <Handle>]...     [CONTAINS <String>]... [ICONTAINS <String>]...
       [WAIT [Timeout]]
 
DELETE [PRIORITY <Priority>]... [MACHINE <Machine>]... [NAME <Name>]...
       [HANDLE <Handle>]...     [CONTAINS <String>]... [ICONTAINS <String>]... 
 
LIST   [HANDLE <Handle>]
 
HELP
RESPOOL Allows you to manage exclusive access to entries within resource pools.

CREATE  POOL <PoolName> DESCRIPTION <Pooltext>
 
DELETE  POOL <PoolName> CONFIRM [FORCE]
 
QUERY   POOL <PoolName>
 
REQUEST POOL <PoolName> [TIMEOUT <Timeout>] [FIRST | RANDOM]
 
RELEASE POOL <PoolName> ENTRY <Value> [FORCE]
 
ADD     POOL <PoolName> ENTRY <Value> [ENTRY <Value>]...
 
REMOVE  POOL <PoolName> ENTRY <Value> [ENTRY <Value>]... CONFIRM [FORCE]
 
LIST
 
VERSION
 
HELP
SEM Allows you to manipulate and manage mutex and event semephores.

MUTEX <Name> <REQUEST [Timeout] | RELEASE [FORCE] | DELETE | QUERY>
 
EVENT <Name> <POST | RESET | PULSE | WAIT [Timeout] | DELETE | QUERY>
 
LIST <MUTEX | EVENT>
 
HELP
SERVICE Allows you to manage STAF services and requests.

LIST    [SERVICES | REQUESTS [PENDING] [COMPLETE]]
 
QUERY   REQUEST <Request Number>
 
FREE    REQUEST <Request Number> [FORCE]
 
ADD     SERVICE <Service Name> LIBRARY <Library Name>
        [EXECUTE <Executable>] [OPTION <Name=[=Value]>]...
        [PARMS <Parameters>]
        
REMOVE  SERVICE <Service Name>
      
HELP
SHUTDOWN Allows you to manage the STAFProc daemon process.

SHUTDOWN
 
NOTIFY REGISTER   [MACHINE <Machine>] [HANDLE <Handle> | NAME <Name>]
                  [PRIORITY <Priority>]
 
NOTIFY UNREGISTER [MACHINE <Machine>] [HANDLE <Handle> | NAME <Name>]
                  [PRIORITY <Priority>]
 
NOTIFY LIST
 
HELP
TRUST Allows you to manipulate and manage trust levels (security).

SET <MACHINE <Machine> | DEFAULT> LEVEL <Level>
 
GET MACHINE <Machine>
 
DELETE MACHINE <Machine>
 
LIST
 
HELP
VAR Allows you to manipulate and manage global and process specific variable pools.

[GLOBAL | HANDLE <Handle>] SET <Name=Value> [SET <Name=Value>] ...
 
[GLOBAL | HANDLE <Handle>] GET <Name>
 
[GLOBAL | HANDLE <Handle>] DELETE <Name> [DELETE <Name>] ...
 
[GLOBAL | HANDLE <Handle> | ONLYHANDLE <Handle>] LIST
 
[GLOBAL | HANDLE <Handle>] RESOLVE <String> [RESOLVE <String>]..
 
HELP
ZIP Allows for zipping, unzipping, deleting entries in Zip archives which are PKZip, WinZip and Jar compatible.

ZIP    ADD ZIPFILE <Name> < FILE <Name> | DIRECTORY <Name> [RECURSE] >
       [RELATIVETO <Directory>] 
 
UNZIP  ZIPFILE <Name> TODIRECTORY <Name>
       [FILE <Name>]... [RESTOREPERMISSION] [REPLACE]
 
LIST   ZIPFILE <Name>
 
DELETE ZIPFILE <Name> FILE <Name> [FILE <Name>]... CONFIRM
 
VERSION
 
HELP