Globus Toolkit 3.2: User's Guide
Overview
>Using Command Line Clients
Using Command Line Clients
This page contains information about how to use command line clients in Globus Toolkit 3.2 as well as some scripts for Globus and OGSI. This page is still under construction, so check back often for more information.
This page contains the following topics:
- Setting your environment
- Generating command line clients
- Command line clients
- Globus Specific Scripts
- OGSI Scripts
Setting your environment
You need to set your environment before using any Globus Toolkit Version 3.2 (GT3.2) command. You need to do this on both the client and server machines.
First, make sure you have set the GLOBUS_LOCATION environment variable to the location of your GT3.2 installation.
For Unix, this would look like the following example:
export GLOBUS_LOCATION=/usr/gt3
For Windows, this would look like the following example:
set GLOBUS_LOCATION c:\gt3
There are two environment scripts, called GLOBUS_LOCATION/etc/globus-user-env.sh and GLOBUS_LOCATION/etc/globus-user-env.csh. Enter the one that corresponds to the type of shell you are using.
For example, in csh or tcsh, you enter:
source $GLOBUS_LOCATION/etc/globus-user-env.csh
In sh, bash, ksh, or zsh, you enter:
. $GLOBUS_LOCATION/etc/globus-user-env.sh
Setting the classpath
Once you've set your environment, you can use the setenv scripts
to set the proper classpath environment variable in order to launch a Java
class from the command-line.
To set the classpath on Windows, run:
%GLOBUS_LOCATION%\setenv.bat
To set the classpath on Unix/Linux machines, run:
for bash/sh
. $GLOBUS_LOCATION/setenv.sh
for csh/tcsh
source $GLOBUS_LOCATION/setenv.csh
Generating command line scripts
We provide a minimal set of generic command line clients that can be used to test your grid services. The command line clients for Core are implemented in the org.globus.ogsa.client package.
To generate the command-line scripts for your target platform, run:
ant setup
The scripts are generated in the bin/ directory.
For a given command-line tool, the corresponding script takes care of setting the classpath and specifying the Java class name. You need to set the GLOBUS_LOCATION variable in your shell. Note for Windows users it may happen that you run out of environment variable character length. If you do you can use the subst command to map the actual GLOBUS_LOCATION to a volume (e.g. subst f: <your globus location>). On Unix/Linux you can use similar workarounds using ln -s , if the problem occurs.
[how is the below related to the above?]
There are times when you need to launch a Java class from the command-line. Bourne Shell and Windows batch scripts can be automatically generated in order to hide from the user the setting of the classpath and the specification of the Java class. An example of this is the generation of the command-line clients provided with the platform.
To provide automatic generation of a client script, write an Ant target that
calls the generateLauncher Ant target in build-client.xml. You must
specify the following properties/parameters:
${launcher-name}: base name of script to generate.${class-name}: name of Java class the script must call.
For example:
<ant antfile="build-client.xml" target="generateLauncher"
dir="${ogsa.root}">
<property name="launcher-name" value="myClient"/>
<property name="class-name" value="org.mypackage.MyClient"/>
</ant>
You can also specify defaults JVM options and command-line using the ${default.jvm.options} and ${default.cmd.line} Ant
properties.
Command line clients
Globus Specific Scripts
globus-start-container
Starts up our standalone hosting environment container
globus-stop-container
Stops our standalone hosting environment container
globus-service-browser
Starts sample service browser gui
Scripts to Perform OGSI Operations
ogsi-create-service
Creates a service and prints out the GSR
ogsi-destroy-service
Destroys a service instance
ogsi-find-service-data-by-name
Searches for Service Data Element values in a service by name.
ogsi-find-service-data-by-xpath
Searches for Service Data Element values in a service using an xpath expression.
ogsi-set-service-data-by-name
Adds Service Data Element values to a service.
ogsi-delete-service-data-by-name
Deletes Service Data Elements in a service.
ogsi-get-gwsdl-port-types
Parses WSDL file and prints out gwsdl port types and contained service data
ogsi-request-termination
Sets a new timeout on a service instance.
ogsi-add-service
Adds a service to a Service Group Registration service supporting remote registration.
ogsi-remove-service
Removes a service from a Service Group Registration service supporting remote registration.
ogsi-resolve-handle
Resolves a handle (GSH) to a reference (GSR)
ogsi-notification-sink
Starts up a standalone notification sink, and logs the handle of the sink that can be used to send it messages. Messages are logged to stdout.
ogsi-notification-sink-notifyer
Sends a test message to a notification sink
ogsi-notification-topic-listener
Starts up a sink and subscribes it to a service data element (topic) in a source service. Messages are logged to stdout.
For detailed help on allowed arguments use the -help option.
All clients take a handle to its target service, which it resolves. All services
can also be invoked using all the security features described in the Core's Security
Support.