This function copies a source file to destination file to host
Location of target host
The name of remote host (default localhost)
The name of the source fule
The name of the destination fule
'%s' % location
'fs'
'COPY FILE %s TOFILE %s TOMACHINE %s' % (srcfile,destfile,remotehost)
{ 'returncode' : cmdRC ,
'result' : cmdResult }
[cmdRC,cmdResult]
Copies files by extension from a source to destination folder on host
Location of target host
The name of remote host (default same as location)
The name of the source folder
The name of the destination file
The name of the file extension (default txt)
'%s' % location
'fs'
'COPY DIRECTORY %s TODIRECTORY %s TOMACHINE %s EXT %s RECURSE' % (srcfolder,destfolder,remotehost,extension)
{ 'returncode' : cmdRC ,
'result' : cmdResult }
cmdRC
Copies folder from a source to destination folder on host
Location of target host
The name of remote host (default same as location)
The name of the source folder
The name of the destination file
'%s' % location
'fs'
'COPY DIRECTORY %s TODIRECTORY %s TOMACHINE %s RECURSE' % (srcfolder,destfolder,remotehost)
{ 'returncode' : cmdRC ,
'result' : cmdResult }
cmdRC
This function zips up a folder
Location of target host
Name of the file to place zip file contents
Name of destination folder to place zip file contents
Folder that the zip archive is relative to
'%s' % location
'zip'
'ADD ZIPFILE %s DIRECTORY %s RECURSE RELATIVETO %s' % (zipfile,folder,relativeto)
{ 'returncode' : cmdRC ,
'result' : cmdResult }
cmdRC
This function unzips a compressed zip archive
Location of target host
Name of the file to place zip file contents
Name of file to unzip
Name of directory to unzip
Name of destination folder to place zip file contents
'%s' % location
'zip'
'UNZIP ZIPFILE %s TODIRECTORY %s %s %s RESTOREPERMISSION REPLACE' % (zipfile,unzipdir,file,dir)
{ 'returncode' : cmdRC ,
'result' : cmdResult }
cmdRC
This function deletes a file
Location of target host
Name of file to be deleted
'%s' % location
'fs'
'GET ENTRY %s TYPE' % (filename)
'Success: File does not exist, dont delete it.'
0
'Success: File does exists, will delete it'
'%s' % location
'fs'
'DELETE ENTRY %s CONFIRM' % filename
{ 'returncode' : cmdRC ,
'result' : cmdResult }
cmdRC
This function recursively deletes a folder
Location of target host
Name of folder to be deleted
'%s' % location
'fs'
'GET ENTRY %s TYPE' % foldername
'Folder does not exist, do not delete it.'
0
'Folder exists, will delete it'
'%s' % location
'fs'
'DELETE ENTRY %s RECURSE IGNOREERRORS CONFIRM' % (foldername)
{ 'returncode' : cmdRC ,
'result' : cmdResult }
cmdRC
This function creates a folder
Location of target host
Name of folder to be created
'%s' % location
'fs'
'CREATE DIRECTORY %s FULLPATH' % foldername
{ 'returncode' : cmdRC ,
'result' : cmdResult }
cmdRC
Queries the staf logs from startfrom point
Location of target host
Name of file to be deleted
Name of file to be deleted
Name of file to be deleted
'%s' % location
'log'
'QUERY ALL MACHINE %s LOGNAME %s FROM %s TO %s' % (location,logname,startfrom,endat)
Sets a variable in the staf var service
Location of target host
Name of file to be deleted
Name of file to be deleted
'Set %s Variable %s' % (type,variable)
'%s' % location
'var'
'SET %s VAR %s' % (type,variable)
Gets a variable in the staf var service
Location of target host
Type of variable
Name of variable
'Get %s Variable %s' % (type,variable)
'%s' % location
'var'
'GET %s VAR %s' % (type,variable)
Resolve a variable in the staf var service
Location of target host
Type of string to be resolved
Name of string to be resolved
'Resolve %s Variable %s' % (type, name)
'%s' % location
'var'
'RESOLVE %s {%s}' % (type, name)
Retrieves an attribute of a file system entry
Location of target host
Name of entry to retrieve attributes
Type of attributes to be retrieved
'Retrieve attribute %s for %s.' % (attribute,entry)
'%s' % location
'fs'
'GET ENTRY %s %s' % (entry,attribute)
[cmdRC,cmdResult]
This function lists a folder
Location of target host
Name of folder to be list
Name of file to be list
'%s' % location
'fs'
' LIST DIRECTORY %s NAME %s LONG ' % (foldername,filename)
'Folder does not exist.'
0
{ 'returncode' : cmdRC ,
'result' : cmdResult }
cmdRC
This function lists a folder by extension
Location of target host
Name of folder to be list
he name of the file extension (default txt)
'%s' % location
'fs'
' LIST DIRECTORY %s EXT %s RECURSE' % (foldername,extension)
{
'returncode' : cmdRC ,
'result' : cmdResult
}
cmdResult
This function get the contents of a file
Location of target host
The name of the file
The type of the file
The format of the file
'%s' % location
'fs'
'GET FILE %s %s FORMAT %s' % (filename,type,format)
[cmdRC,cmdResult]
Send event.
Location of target host
Name of event to send
'Send Event %s on %s' % (name, location)
'%s' % location
'sem'
'PULSE EVENT %s' % name
Wait event.
Location of target host
Name of event to wait
'Wait Event %s on %s' % (name, location)
'%s' % location
'sem'
'WAIT EVENT %s' % name
Delete event.
Location of target host
Name of event to delete
'Delete Event %s on %s' % (name, location)
'%s' % location
'sem'
'DELETE EVENT %s' % name
Add STAF Java Service.
Location of target host
Name of the service to add
Jar of the service to add
JVM path
JVM options
'Check if STAF Java Service %s is already started on %s' \
% (serviceName, location)
'%s' % location
'service'
'query service %s' % serviceName
'Add STAF Java Service %s on %s' % (serviceName, location)
'service %s' % cmdOptions
'%s' % location
'service'
'%s' % cmdOptions
'STAF Java Service %s is already started on %s' \
% (serviceName, location)
Remove STAF Java Service.
Location of target host
Name of the service to add
'Remove STAF Java Service %s on %s' % (serviceName, location)
'%s' % location
'service'
'%s' % cmdOptions