EGEE Home | JRA1 Home | JRA1 DM Home | EDMS Documents | People | Calendar | Agenda maker | Glossary

FTS Usage

euroflag.gif (3058 octets)

FTS Home
Documents
Wiki

Download

CVS Source
Bug Tracking
For Developers
Links
The FTS has three interfaces for different purposes:
  • The File Transfer interface
  • The Channel Management interface
  • The File Transfer Status interface

These three interfaces provide the following functionality:

File Transfer Interface
Channel Management Interface
Status Interface
  • Submit File Transfer jobs
  • Get status on current jobs
  • List requests in a given state
  • Cancel a transfer
  • Set priority of a transfer
  • Add, remove and list VO managers
  • Add a new channel for this FTS
  • Set channel parameters:
    • Bandwidth
    • Nominal Throughput
    • Number of concurrent files being transferred
    • Number of concurrent streams
    • VO Share
    • Operational State
    • Management Contact
  • List current channels
  • Delete channels
  • Add, remove and list channel managers
  • Manage jobs in HOLD state
  • List all File Transfer Agents running on the given service
  • List activity of a given VO
  • List Channel activity
  • Summarize activity of channel or VO

Command-Line Tools

The gLite FTS provides a set of command-line client tools that can be called as executables to interact with an FTS service. Please note that some calls require special authorization. See the authorization matrix. There are several sets of command line tools:

All FTS Interface command-line tools (the first three in the list above) and the SRM support the options in the table below. These interfaces also have manual pages (online versions thereof are linked in the tables) that you can always view from the command line if your MANPATH variable contains $GLITE_LOCATION/share/man.

Option
Description
Interface
-h Print a short help message on parameters and usage, and exit.
T,C,S,R
-q Quiet operation
T,C,S,R
-s SERVICE

Specifies the service endpoint to use. If URL starts with http://, https:// or httpg://, then it is taken as a direct service endpoint URL. Otherwise SERVICE is taken as a service instance name and Service Discovery is invoked to look up the endpoint.
If this option is not specified, Service Discovery will be invoked and the first available transfer service will be used. If the Service Discovery fails, the program will exit with an error.

Note: If this option is not specified, only services with a known good status will be returned by Service Discovery. However if you explicitly specify a service name or an endpoint, the tool will try to use it regardless of its registered status.

T,C,S,R
-v Increase verbosity
T,C,S,R
-V Print tool version and exit
T,C,S,R
--source SSITE Specify source site to use. If used with the --dest option, service discovery is used to get the associated FileTransfer services of the ChannelAgent services which provide a channel from SSITE to DSITE. This is an alternative to the usual -s option or to service discovery looking up the default File Transfer Interface to connect to.
T
--dest DSITE The destination site to use in conjunction with the --source option.
T

Common command-line options. The last column indicates for which interface the command-line option is valid (T: File Transfer Interface; C: Channel Management Interface; S: Status Interface, R: SRM command line tools):

CLI for File Transfer Interface

The following command-line tools are available for the File Transfer interface funcitons. All commands accept the common options described above.

glite-transfer-addvomanager  VONAME MANAGER

Adds a manager to the given VO. The VO is given as a string. The manager can be given as a DN, or a VOMS group.

glite-transfer-cancel JOBID

Cancel the job with the given ID.
glite-transfer-getroles Returns the roles of the client on the service.
glite-transfer-list STATE STATE ...

List all ongoing data transfers in the given states. If you want to restrict yourself to a specific channel only, use the -c flag in addition to the given states:

-c CHANNEL

glite-transfer-listvomanagers VONAME List all managers of the given VO
glite-transfer-removevomanager VONAME PRINCIPAL Remove the given principal as a manager of the specified VO
glite-transfer-setpriority JOBID PRIORITY Sets the priority of the job identified with the given ID.
glite-transfer-status JOBID Prints the status of the given job.
glite-transfer-submit  SOURCE-SURL DEST-SURL | -f FILE

This command submits a data transfer job to the FTS. It returns the ID of the job by which it can be monitored. The command can be invoked in two different ways: either by specifying the source and the destination SURL or by giving the name of a file using the -f option which contains source and destination SURL pairs, one per line, separated by whitespace. Whitespace in the names of the SURLs needs to be protected with a backslash \.

Additional options available for this command are (of course all common options are supported as well)

-b Blocking mode. Don't return an ID but simply block until the transfer has been successfully carried out. This may take a very long time depending on the length of the queue and the availability of the source (maybe it needs to be brought in from tape).
-i TIME Interval between status calls in blocking call. Works only together with -b. The TIME parameter has to be given in seconds
-p PASSWORD The MyProxy password to be sent with the job
-g PARAMS Parameters to be sent to gsiftp. This is a string that contains all parameters just like it was given to the globus-url-copy tool.
-m SERVER Use the given MyProxy server. If not given, the FTS's associated MyProxy service will be used which is looked up from Service Discovery.
-f FILE The file to be read as explained above (a pair of SURLs per line, separated by whitespace). If the FILE is given as - (a dash) then stdio is read (can be used in scripts to pipe the list of files into the command).
glite-transfer-submit-placement DEST-SE LFN .. | -f FILE DEST-SE

This command submits a data placement job to the FTS/FPS. It returns the ID of the job by which it can be monitored. The command can be invoked in two different ways: either by specifying the name of the destination SE and a list of LFNs or by providing the name of a file using the -f option which contains a list of LFNs (one per line, whitespace protected by a backslash \) and the destination SE.

Additional options available for this command are (of course all common options are supported as well)

-p PASSWORD The MyProxy password to be sent with the job
-g PARAMS Parameters to be sent to gsiftp. This is a string that contains all parameters just like it was given to the globus-url-copy tool.
-m SERVER Use the given MyProxy server. If not given, the FTS's associated MyProxy service will be used which is looked up from Service Discovery.
-f FILE The file to be read as explained above (a pair of SURLs per line, separated by whitespace). If the FILE is given as - (a dash) then stdio is read (can be used in scripts to pipe the list of files into the command).

CLI for the Channel Management Interface

The following command-line tools are available for the File Transfer interface funcitons. All commands accept the options described above.

glite-transfer-channel-add CHANNEL-NAME SITE-A SITE-B

Creates a new transfer channel. The user has to be an authorized channel manager to be able to use these commands. The CHANNEL-NAME is the name which will be published into Service Discovery and is usually composed of the two site names separated with a dash. Site A and Site B are the names of the sites again as they are defined in the information system accessible by Service Discovery. The channel is directed: from Site-A (source) to Site-B (target).

-b BANDWIDTH The bandwidth of the new channel (in Mbit/s).
-c CONTACT The contact e-mail address for the new channel.
-f FILES The number of concurrent files allowed on the channel
-S STATE Set the operational state of the channel
-t THROGHPUT The maximal throughput of the channel
-T STREAMS The number of streams on the channel - this is different from the number of files as each file may have several open streams.

glite-transfer-channel-addmanager CHANNEL PRINCIPAL

Add a new manager for the given channel
glite-transfer-channel-drop CHANNEL Destroys a channel definition and removes it from the system. Use with care.
glite-transfer-channel-list CHANNEL CHANNEL ...

Listing available data transfer channels. If CHANNELs are given on the command line, detailed information about the specified channels are listed. Otherwise, without arguments, simply the names of all defined channels are displayed.

glite-transfer-channel-listmanagers CHANNEL List all managers of the given CHANNEL
glite-transfer-channel-removemanager CHANNEL PRINCIPAL Remove the given principal as a manager of the specified CHANNEL
glite-transfer-channel-set CHANNEL ...

Modify the properties of a given CHANNEL or list of channels. The properties that can be changed are

-b BANDWIDTH The bandwidth of the new channel (in Mbit/s).
-c CONTACT The contact e-mail address for the new channel.
-f FILES The number of concurrent files allowed on the channel
-S STATE Set the operational state of the channel
-t THROGHPUT The maximal throughput of the channel
-T STREAMS The number of streams on the channel - this is different from the number of files as each file may have several open streams.
glite-transfer-channel-setvoshare CHANNEL VONAME SHARE

Set the share of the given channel for a VO. The share is given in relative numbers. Example:

VO1 has share A.
VO2 has share B.
VO3 has share C.

When all 3 VOs have jobs, the percentage chance that a job will get taken is for VO1 is:

A/(A+B+C)

When only A and B have jobs and C is empty, the chance is:

A/(A+B)

The absolute numbers of the value given to the command does not matter, i.e. the shares can be for example 10,20,30 or 0.1,0.2,0.3 to achieve the same effect.

glite-transfer-channel-signal  [-j JOBID | -c CHANNEL] STATE

Change the state of held jobs. Either the job ID can be specified to change the state of a specific job or the channel name to change the state of ALL held jobs on a given channel at once. Valid states are 'Pending', 'Failed' and 'Canceling'.


CLI for the Status Interface

The following command-line tools are available for the File Transfer interface funcitons. All commands accept the options described above.

glite-transfer-stats-agents

List all agents running on the service

glite-transfer-stats-channel CHANNEL

Lists the summary and activity of channel usage for the given channel.

-b START Start time in YYYY-MM-DD,HH:MM:SS format. If not specified, start time is the creation time of the channel.
-e END End time in YYYY-MM-DD,HH:MM:SS format. If not specified, end time is the time of request processing.
-o VO,VO,.. A comma separated list of VOs the user is interested in. If not specified, all VOs are listed.
glite-transfer-stats-vo VONAME

Lists the summary and activity of VO usage.

-b START Start time in YYYY-MM-DD,HH:MM:SS format. If not specified, start time is the creation time of the VO channel.
-e END End time in YYYY-MM-DD,HH:MM:SS format. If not specified, end time is the time of request processing.
-o CHANNEL,CHANNEL,.. A comma separated list of CHANNELs the user is interested in. If not specified, all channels are listed.


CLI for direct SRM interaction

The following command-line tools should be used carefully, they allow direct interaction with the SRM interface so you should be familiar with the SRM to use them correctly. Currently only version 1 of the SRM interface is supported, but version 2 will be supported too as well. These command-line tools also support the usual common options as the FTS tools do. It is not really part of the FTS interface but rather a separate set of tools, usually used to check whether an SRM responds properly to the proper SOAP calls by a given client.

glite-srm-delete SURL ...

Do an srm delete on the given SURLs.

glite-srm-get SURL ..

Perform an SRM get call on the given SURLs. The purpose of that call is to retrieve a valid Transport URL (TURL) with an actual access protocol (by default gsiftp, or specified with the -p option) for the given SURLs.

The call returns the request ID which can be used on subsequent status commands to see the status of the current request and to actually retrieve the TURLs of the SURLs.

-p PROTOCOL The protocol of the TURL to retrieve. Valid protocols for a given SRM can be listed using glite-srm-get-protocols. The default is gsiftp.
-e Don't do the command but give an estimate of how long it may take.
glite-srm-get-protocols 

List the protocols supported by the SRM.

glite-srm-get-status REQUEST_ID Retrieve the complete information on a request previously made on the SRM.

This information includes the id, type, state and other items belonging to the request itself, as well as additional information on each file inside it.

glite-srm-mk-permanent SURL .. Indicate to the SRM that the given SURLs are to be made persistent.
glite-srm-pin SURL .. Advise the SRM that the client will be using the file in the near future. This pin has as expiration time, set by the SRM. A second pin operation will renew the timeout, subject to local policy.
glite-srm-ping Check that the serivce is alive.
glite-srm-set-status REQUEST_ID FILE_ID STATE Update the current status of a file in a specific request. This will normaly be changing the state from 'Pending' to 'Running' once a transfer is started, and then to 'Done' once it is finished, or from any state to 'Failed'.
glite-srm-put

Perform an SRM put call on the given SURLs. The purpose of that call is to retrieve a valid Transport URL (TURL) with an actual access protocol (by default gsiftp, or specified with the -p option) for the given SURLs.

The call returns the request ID which can be used on subsequent status commands to see the status of the current request and to actually retrieve the TURLs of the SURLs.

-p PROTOCOL The protocol of the TURL to use for putting a file into the SRM. Valid protocols for a given SRM can be listed using glite-srm-get-protocols. The default is gsiftp.
glite-srm-unpin TURL .. REQUEST_ID Release the pin previously acquired with srm-pin on the TURLs.

CLI for direct interaction with the Gridftp Server

The following command-line tools allow the user to send direct commands to a Gridftp Server. They are the gLite port and extension of the EDG Gridftp command line tools. The common options they all share are:

Option
Description
-h Print a short help message on parameters and usage, and exit.
-n No data channel authentication (gridftp NODCAU option). (Only relevant for exists, ls)

All commands take a fully qualified gridftp URL as their argument. These URLs have 'gsiftp' for their schema and contain the full hostname of the remote server. Optionally also the port can be specified (it defaults to 2811). Example: gsiftp://gserver.cern.ch/data/user/smith/file1.dat

glite-gridftp-exists GRIDFTP_URL

Check the existence of a file. The -n option will switch off data channel authentication (nodcau).

glite-gridftp-ls [-l] GRIDFTP_URL

List a directory on a remote gridftp server. The given GRIDFTP_URL must refer to a directory. If the -l option is given, the listing will be more verbose, printing the size and date of the files.

glite-gridftp-mkdir [-p] GRIDFTP_URL

Make a new directory, given in the argument. If the -p option is given, nonexisting parent directories will also be created (just like for the unix mkdir command).

glite-gridftp-rename SOURCE_URL DEST_URL Rename a file on a remote gridftp server. The two URLs must have the same host.

 

glite-gridftp-rm GRIDFTP_URL Remove a file from the gridftp server.
glite-gridftp-size GRIDFTP_URL Get the size of a file.

glite-url-copy : CLI for direct SRM to SRM transfer

The following command-line tools can be used to test SRM - SRM transfer directly. These commands are used by the FTS server when the actual transfers are performed so it is also a great tool to test the transfer part of the FTS. For the regular operations please use the FTS instead. The command is derived from the well-known globus-url-copy command that has been part of the globus toolkt since GT2. The glite version of this command has the same functionality as the globus version, with two important additions:

  • Support for SURLs. The command accepts valid SRM SURLs for both source and target.
  • Asynchronous operation. The command does not block but returns immediately with an ID that can be used on subsequent 'status' poll requests.

The table below gives the common options for the glite-url-copy command line tools.

glite-url-copy SOURCE TARGET

Copy a file. This command is asynchronous and will return immediately with a url-copy ID that can be used with subsequent calls of glite-url-copy-status. The source and target are to be given as fully qualified URLs. Accepted URL schemas are:

  • file
  • gsiftp
  • http
  • ftp
  • srm

The 'srm' schema is used for SURLs. In order to copy files to or from gridftp servers (gsiftp schema) or SRMs, you have to have a valid proxy certificate at the time of the call. The command accepts the following options:

-b Blocking call. Don't return an ID but block on the call. The -v and -d options are particularly useful with -b because they will print additional information on screen while the command is processing.
-c Check whether the transfer already exists. This is a very expensive operation so normally this check is disabled. It should be enabled if there is a risk that a transfer may be submitted multiple times.
-d Increase the log level to DEBUG.
-v Verbose (print a lot of information to screen)
-s URL Set the source SRM endpoint. If this option is used, the source SURL may be a 'short hand' form SURL, not containing the full SRM path (it will be retrieved from the configuration or from the information system).
-e URL Set the target SRM endpoint. If this option is used, the target SURL may be a 'short hand' SURL.
-p prefix Prefix the ID with the given string. Useful for scoping IDs (the FTS does that)
-n streams Number of streams to use for gridftp transfers
-S size The tcp block size to use for gridftp transfers
-t N The total transfer timeout in seconds.
-m N The transfer marker timeout for gridftp transfers. Gridftp sends markers every 5 seconds usually while the transfer is running. This timeout should be set such that if a marker is not received for N seconds, the transfer is aborted.
-g N The SRM get timeout
-u N The SRM put operation timeout
-h Print a help screen and exit
glite-url-copy-srm SOURCE TARGET ... | -f FILE

The srm-copy version of the glite-url-copy command. In the glite-url-copy case, an SURL is translated into a valid gsiftp TURL using the SRM interface and gridftp is used to transfer the file. If this command is used, the native SRM copy mechanism is used to transfer the file instead. The drawback in using this method is the very limited control the client has on the command once it's been issued. There can be a number of sources and targets given on the command line (or a file containing one pair per line can be given) as the SRM copy method accepts multiple files to be copied with a single call.

-d Increase the log level to DEBUG.
-p prefix Prefix the ID with the given string. Useful for scoping IDs (the FTS does that)
-t N The total transfer timeout in seconds.
-h Print a help screen and exit
glite-url-copy-status ID

Print the status of the ongoing transfer with the given ID.

-d Increase the log level to DEBUG.
-v Verbose (print a lot of information to screen)
-h Print a help screen and exit
glite-url-copy-stop ID

Stop the ongoing transfer with the given ID.

-f Force (in the case of glite-url-copy-srm). Even if there is no possibility to establish a connection to the SRM server, move all transfers to 'failed' status.
-h Print a help screen and exit

 

glite-data-transfer-fts-info-provider

This is the info provider for the BDII information system, to be used to publish instances of FTS in to BDII. The full description and options can be found here. The info provider is only used by the administrators of the FTS service.


Java API

See the Javadoc pages for details as well.

The gLite FTS is a secure Web Service that comes with a WSDL and communicates over https using SOAP. Therefore clients can be generated in every language easly from the WSDL. The Java client is automatically generated using the Apache Axis wsdl2java tool. There are four packages in the Java interface. These are:

The following listing gives an example how to connect to the FTS using the Java API. For brevity, some familiarity with Java is assumed, in particular how to catch and handle properly standard Java language exceptions (the listing code is not a good example in this regard); the class definition is also omitted. The FileTransferServiceLocator class is used to retrieve an instance of the FileTransfer interface, reachable at the service endpoint specified by the URL that is passed to the getFileTransfer method (line 16).

1  import org.glite.data.transfer.fts.FileTransfer;
2  import org.glite.data.transfer.fts.FileTransferServiceLocator;
3  import java.net.URL;
4  import javax.xml.rpc.ServiceException;
5
6  public static final String SERVICE_ENDPOINT =
7      "https://host.domain:8443/SERVICEID/" +
8      "glite-data-transfer-fts/services/FileTransfer";
9
10 private FileTransfer getService() throws Exception {
11     URL url = new URL(SERVICE_ENDPOINT);
12     FileTransfer fts = null;
13     FileTransferServiceLocator ftsLoc = new FileTransferServiceLocator();
14
15     try {
16         fts = ftsLoc.getFileTransfer(url);
17     } catch (ServiceException se) {
18         // Cannot connect. Handle the exception.
19     }
20
21     return fts;
22 }

Listing 1: Acquiring the FTS client object.

The same mechanism can be used to acquire a ChannelManagement or a FileTransferStats interface implementation. The Locator object has to be created and its getInterface method invoked where Interface is actually the name of the interface desired.

Submitting a Job

In order to submit a job through Java, you have to call the 'submit' or 'placementSubmit' methods on the interface, as explained in the Javadoc.

In order to submit a job, the job description needs to be built up. This is done using the TransferJob object. The listing below shows an example of creating and submitting a
basic job. For brevity, the surrounding class and the imports are omitted. The class TransferJob has three members with normal Java bean setter methods:

  • The TransferJobElements member is an array of transferJobElemen objects and is required.
  • The transferParams is currently only used to specify the gridFTP paramaters using the key 'gridFTP' and value format '-tcp-bs 1000 -p 10' as described earlier. If not set, the service defaults will be used. It is recommended to use the service defaults, i.e. to ignore this option.
  • The credential member is a String which should be set to the MyProxy password that was used to upload the credential; it is required.

 

1  private void runExample() {
2  FileTransfer fts = getService();
3  TransferJob tjob = new TransferJob();
4
5  TransferJobElement[] te_array = new TransferJobElement[10];
6  for (int i = 0; i < 10; i++) {
7      String src =
8        "srm://host.test1:8443/srm/managerv1?SFN=/data/test1/testfile" + i;
9      String dest =
10       "srm://dest.test2:8443/srm/managerv1?SFN=/filestore/destfile" + i;
11     TransferJobElement te = new TransferJobElement();
12     te.setSource(src);
13     te.setDest(dest);
14     te_array[i] = te;
15 }
16
17 tjob.setTransferJobElements(te_array);
18
19 tjob.setJobParams(null); // the current service does not support this
20
21 tjob.setCredential("myproxypassword"); // your Myproxy password
22
23 try {
24     String jobId = fts.submit(tjob);
25 } catch (InvalidArgumentException e) {
26     // Malformed job description. Handle the exception..
27 } catch (InternalException e) {
28     // Internal service error. Handle the exception.
29 } catch (AuthorizationException e) {
30     // Not allowed to submit or bad credentials were supplied. Handle it.
31 } catch (ServiceBusyException e) {
32     // The service cannot process your request just now. Handle it.
33 } catch (RemoteException e) {
34     // Something else went wrong. Handle the exception.
35     // This exception is also the superclass of all the others,
36     // so can be used alone to catch all of them.
37 }
38 } // end runExample

Listing 2: Submitting a simple job with 10 files.

Line 2 The connection stub is initialised.
Line 5 This job consists of 10 files
Line 6-15 10 TransferJobElements are created, and the source and destination files set using their Java bean setter methods.
Line 17 The array of TransferJobElements is added to the job using the appropriate setter method.
Line 19-21 The other setters are called.
Line 24 The call is made to the web-service. Upon success the job identifier returned from the service will be put into the String variable jobId.
Line 25 InvalidArgumetException. This exception occurs if the job object is malformed or incomplete.
Line 27 InternalException. This exception occurs if there is an internal problem on the service.
Line 29 AuthorizationException. This exception occurs if the credential sent to the service is not authorized for the submit action or if the client's credential is invalid.
Line 31 ServiceBusyException. This exception occurs if the service is too busy to accept the job.
Line 33 RemoteException. This exception occurs if something goes wrong in the web-service layer or with the connection. It must always be caught. This class is the superclass of all the other exceptions, so catching
it is a lazy way of catching all the others (though it is recommended to catch and handle the others first).

The status ID as returned by the submit call can be used on subsequent 'status' calls to poll the status of the given transfer. See the Javadoc for more details.

 


C API

The FTS comes with a detailed C API and also a library of autogenerated C++ classes. The C API provides a simple version of the API where dedicated constructor and destructor methods are provided to create and destroy the complex types that are used in the API.

This 'simple' C API comes with a complete doxygen documentation.

The CLI tools themselves are the best examples on how to use this API. See the source of these tools in CVS.


Other API


The FTS also has API bindings generated for Perl:

Actually any language may have bindings that has some mechanism to generate client-side code from the WSDL. The WSDL for the FTS can be found at the autogenerated documentation pages of JRA1 DM. The versions for gLite 1.5 are:

 

      Disclaimer Mail to FTS Support Last Modified: 08/12/2005December 8, 2005