stafcmd.xml revision 89b278ac5a398f1ecff50b891cd964c4d80b5a4a
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster<?xml version="1.0" encoding="UTF-8" standalone="no"?>
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster ! CDDL HEADER START
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster ! The contents of this file are subject to the terms of the
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster ! Common Development and Distribution License, Version 1.0 only
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster ! (the "License"). You may not use this file except in compliance
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster ! with the License.
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster ! You can obtain a copy of the license at
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster ! See the License for the specific language governing permissions
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster ! and limitations under the License.
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster ! When distributing Covered Code, include this CDDL HEADER in each
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster ! file and include the License file at
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster ! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster ! add the following below this CDDL HEADER, with the fields enclosed
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster ! by brackets "[]" replaced with your own identifying information:
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster ! Portions Copyright [yyyy] [name of copyright owner]
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster ! CDDL HEADER END
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster ! Copyright 2007-2009 Sun Microsystems, Inc.
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster ! Portions Copyright 2011 ForgeRock AS.
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster This function copies a source file to destination file to host
c4329510051cce0c6b3efc1fae122ec4c5d61efaDavid Luna <function-arg-def name="location" type="optional" default="STAXServiceMachine">
c4329510051cce0c6b3efc1fae122ec4c5d61efaDavid Luna Location of target host
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster <function-arg-property name="type" value="hostname"/>
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster <function-arg-def name="remotehost" type="optional" default="STAXServiceMachine">
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster The name of remote host (default localhost)
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster <function-arg-property name="type" value="hostname"/>
c4329510051cce0c6b3efc1fae122ec4c5d61efaDavid Luna <function-arg-def name="srcfile" type="required">
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster The name of the source fule
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster <function-arg-property name="type" value="filename"/>
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster <function-arg-def name="destfile" type="required">
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster The name of the destination fule
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster <function-arg-property name="type" value="filename"/>
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster 'Copy file %s:%s to %s:%s.' \
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster % (location,srcfile,remotehost,destfile)
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster destfolder = os.path.dirname(destfile)
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster { 'location' : location,
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster 'foldername' : '%s' % destfolder
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster <request>'COPY FILE %s TOFILE %s TOMACHINE %s' % (srcfile,destfile,remotehost) </request>
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster cmdResult=STAFResult
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster { 'returncode' : cmdRC ,
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster 'result' : cmdResult }
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster Copies files by extension from a source to destination folder on host
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster <function-arg-def name="location" type="optional" default="STAXServiceMachine">
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster Location of target host
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster <function-arg-property name="type" value="hostname"/>
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster <function-arg-def name="remotehost" type="optional" default="location">
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster The name of remote host (default same as location)
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster <function-arg-property name="type" value="hostname"/>
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster <function-arg-def name="srcfolder" type="required">
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster The name of the source folder
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster <function-arg-property name="type" value="foldername"/>
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster <function-arg-def name="destfolder" type="required">
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster The name of the destination file
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster <function-arg-property name="type" value="foldername"/>
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster <function-arg-def name="extension" type="optional" default="'txt'">
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster The name of the file extension (default txt)
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster <function-arg-property name="type" value="file extension"/>
c4329510051cce0c6b3efc1fae122ec4c5d61efaDavid Luna 'Copy all %s Files from %s:%s to %s:%s.' \
c4329510051cce0c6b3efc1fae122ec4c5d61efaDavid Luna % (extension,location,srcfolder,remotehost,destfolder)
c4329510051cce0c6b3efc1fae122ec4c5d61efaDavid Luna <stafcmd name="'STAF Command: Copy all %s Files.' % (extension)">
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster 'COPY DIRECTORY %s TODIRECTORY %s TOMACHINE %s EXT %s RECURSE' \
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster % (srcfolder,destfolder,remotehost,extension)
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster cmdResult=STAFResult
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster { 'returncode' : cmdRC ,
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster 'result' : cmdResult }
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster Copies folder from a source to destination folder on host
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster <function-arg-def name="location" type="optional" default="STAXServiceMachine">
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster Location of target host
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster <function-arg-property name="type" value="hostname"/>
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster <function-arg-def name="remotehost" type="optional" default="location">
c4329510051cce0c6b3efc1fae122ec4c5d61efaDavid Luna The name of remote host (default same as location)
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster <function-arg-property name="type" value="hostname"/>
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster <function-arg-def name="srcfolder" type="required">
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster The name of the source folder
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster <function-arg-property name="type" value="foldername"/>
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster <function-arg-def name="destfolder" type="required">
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster The name of the destination file
5c099afa7c9361afc2f4477fec0e3018588d7840Allan Foster <function-arg-property name="type" value="foldername"/>
<request>'COPY DIRECTORY %s TODIRECTORY %s TOMACHINE %s RECURSE' % (srcfolder,destfolder,remotehost) </request>