2.0 Command-line functions

2.1 Calls on objects

legion_exports_interface
   {[-c] <context name> | -l <LOID>}
   {-w <well-known class type> | -f <function signature>}+
   [-debug] [-help]

Creates an interface from the list of <well-known class type> and <function signature> arguments specified in the argument list. Sends this interface to the object specified by <LOID> or <context path> in the form of a call to the object mandatory function named exportsInterface(). Prints to standard output the return value from the call:

1

if the interface of the object contains the entire interface of functions specified by the user

0

if any one or more of the functions are not exported by the object

-1

(without contacting the specified object) if the user creates a malformed argument list

The <well-known class type> argument is a string in the set of well-known strings. The set can be listed via the legion_wellknown_class tool.

For this tool's purposes, ClassObject is a well-known class string. CommandLineClass and BootstrapMetaClass are not considered well-known classes because they do not have any special member functions, as shown in the examples below.

$ legion_exports_interface /class/LegionClass \    
   -w ClassObject
1
$
$ legion_exports_interface /class/LegionClass \
    -w CommandLineObject
"CommandLineObject" is not a well known class. Exiting.
-1
$
$ legion_exports_interface /class/LegionClass \
   -w LegionClass -w ClassObject
1
$
$ legion_exports_interface /hosts/BootstrapHost \
   -w UnixHostClass
1
$
$ legion_exports_interface /hosts/BootstrapHost \
  -w ClassObject
0
$
$ legion_exports_interface /class/LegionClass \
   -f "     LegionLOID ping();"
1
$
$ legion_exports_interface /hosts/BootstrapHost \
   -f "     LegionLOID ping();" -w UnixHostClass
1
$

The following options are supported:

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_get_interface 
   {[-c] <class context name> | -l <class LOID>} [-debug] [-help]

Retrieves the interface of a Legion object, named by <class LOID> or <context path>, by calling that object's getInterface() member function. Prints the returned interface to stdout.

The example below returns the interface of the LegionClass (the metaclass for all Legion classes).

$ legion_get_interface class/LegionClass
Getting the interface of object:1.01.01..000001fc0b325...
Object Interface:
	void deactivate();
	RestoreStateReply restoreState();
	SaveStateReply saveState(SaveStateRequest);
	LegionLOID ping();
	LegionObjectInterface getInterface();
	int exportsInterface(LegionObjectInterface);
	int addAttribute(ObjectAttribute);
	int addAttributes(ObjectAttributeList);
	int replaceAttribute(ObjectAttribute, ObjectAttribute);
	int replaceAttribute_s(ObjectAttribute, ObjectAttribute);
	int replaceAttributes(ObjectAttributeList,
		ObjectAttributeList);
	int replaceAttributes_s(ObjectAttributeSignatureList,
		ObjectAttributeList);
	int removeAttribute(ObjectAttribute);
	int removeAttribute_s(ObjectAttributeSignature);
	int removeAttributes(ObjectAttributeList);
	int removeAttributes_s(ObjectAttributeSignatureList);
	LegionAttributeList retrieveAttributes(
		ObjectAttribute-List);
	LegionAttributeSignatureList retrieveAttributes_s(
		ObjectAttributeSignatureList);
	LegionAttributeList retrieveAllAttributes();
$

The following options are supported:

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_ping 
   {[-c] <object context name> | -l <object LOID>} 
   [-timeout <seconds>] [-debug] [-help]

Calls the object-mandatory ping() member function on the object named in <object LOID>. If the command returns, the object exists in an active state and its LOID is displayed.

$ legion_ping foo
Pinging:  1.01.66000000.14000000.000001fc0a72...
Returned: 1.01.66000000.14000000.000001fc0a72...
$

If the object is not accessible by the tool, the command will return an error.

$ legion_ping foo
"foo" does not resolve to a valid loid in my context.

The following optional parameters are available:

-timeout <seconds>

The time-out flag specifies a maximum number of seconds to wait for the ping to complete successfully. If the object does not respond to the ping within that amount of time, legion_ping will exit. Please note that legion_ping failing due to a user-specified time-out does *not* necessarily mean that the object is inactive or otherwise unreachable. There is no default time-out setting.

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_list_attributes 
   {[-c] <object context name> | -l <object LOID>} 
   [-L] [<attribute name>] [-debug] [-help]

Lists an object's attributes from the command line. Optional parameters do the following:

-L

Lists the LOID of each attribute.

<attribute name>

Specify the attribute to be listed (more than one attribute can be listed).

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

A very simple example of this command is below. An object's attributes can include architecture, operating system information, host or vault compatibility, encryption information, etc.

$ legion_list_attributes Foo
Foo:
  (ALL)
Total attributes retrieved 1
     favoritecolors('puce', 'apricot')
$
legion_list_invocations 
   {[-c] <object context name> | -l <object LOID>} [-debug] [-help]

Prints a list of currently pending, started, and recently completed invocations for a given object. The output will include information about each invocation's status, timing, progress, and errors.

The following options are supported:

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_object_info 
   {[-c] <object context name> | -l <object LOID>} 
   [-v] [-debug] [-help]

Prints information about a given object. The output (obtained from the object's class) will include the object's host, vault, owner, Object Address, status, etc. Optional parameters do the following:

-v

Print additional details about the specified object (host machine name and context name, OPA, and vault context name).

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_update_attributes 
   {[-c] <object context name> | -l <object LOID>}
   [{-a | -d | -t} <attribute description>] [-u] [-debug] [-help]

Adds, deletes, test, and updates attributes, named in <attribute description>, of an object named in <context path> or <object LOID> from the command line. The <attribute description> parameter takes the form name(val1 ... valn). The attribute description must not contain any spaces or begin with an uppercase letter.

Optional parameters do the following:

-a

Add an attribute.

-d

Delete an attribute.

-t

Test an attribute.

<attribute description>

Specify an attribute to be updated.

-u

Update an object's attributes.

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

The following example adds the attribute favoritenames to object Foo, with the -A flag.

$ legion_update_attributes foo -a "favoritenames(bob, fred)"
IN make_attr_from_input - favoritenames(bob, fred)
** ADDED 1 attributes(s) to object
$

Similarly, you can remove attributes, with the -d flag. Note, however, that all parameters must be included in order to remove an attribute:

$ legion_update_attributes foo -d "favoritenames(bob)"
IN make_attr_from_input - favoritenames(bob)
** WARNING - DELETED 0 attributes(s) from object instead of 1 specified
$
$ legion_update_attributes foo -d "favoritenames(bob, fred)"
IN make_attr_from_input - favoritenames(bob, fred)
** DELETED 1 attributes(s) from object
$

2.2 Calls on class objects

legion_activate_object 
   {[-c] <object context name> | -l <object LOID>} [-debug] [-help]

Activates the object named in <object LOID> or <context path> (i.e., instantiates that object as a process) if it is inert. If the object is already active, the command has no effect.

The following options are supported:

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_create_object
   {[-c] <class context name> | -l <class LOID>}
   <new object context path>
   [-h <host name on which to place new object>]
   [-v <vault on which to place new object>]
   [-H <context path of preferred host class>]
   [-V <context path of preferred vault class>]
   [-Ch <context containing list of preferred hosts>]
   [-Cv <context containing list of preferred vaults>]
   [-d <recorder context path> <debug session name>]
   [-debug] [-help]

Creates an instance of the class named in <class LOID> or <class context path>. No start-up parameters will be supplied for the class or new object. The following options are supported:

-h

Specify a host for the new object.

-v

Specify a vault for the new object.

-H

Specify the preferred host class's context path.

-V

Specify the context path of the preferred vault.

-Ch

Specify a context which contains a list of the preferred hosts.

-Cv

Specify a context which contains a list of the preferred vaults.

-d

Automatically start a legion_record session for the newly created object. This allows you to debug server objects. The object's relevant activity will be recorded by a previously started Legion recorder object, named in <recorder context path>.

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

If the -h flag isn't used, the host is selected by the class. Similarly, the class will choose a vault if the -v flag isn't used. Normally, this means that a random host is selected, but some classes may act differently. If the -Ch or -Cv flag is used, the class will randomly choose a host or vault from the hosts or vaults listed in the specified context. In both cases, the system will not return the LOID of the randomly chosen host. The legion_host_vault_list and legion_vault_host_list commands will allow users to limit the placement of a given class's instances (i.e., any instances of class Foo can only be placed on hosts X, Y, and Z).

legion_create_object_r 
   {[-c] <class context name> | -l <class LOID>} 
   <context path> <host name> <host architecture> 
   <$LEGION> <$LEGION_OPR> <$LEGION_OPA> 
   <binary path> [<user id>]
   [-debug] [-help]

Causes the specified class object to create a new object on the host named in <host name> using the rsh1 (remote shell) mechanism. The object will be managed with rsh, if the class it is invoked on is an rshStartClass. If this utility is invoked on a normal class, normal object create mechanism will be used, and the object will not be managed by rsh. This command is generally used only by the legion_create_host and legion_create_vault scripts, not by users.

The additional arguments specify information for the rsh environment.

<host name>

Specifies the host upon which the new object should be placed. Note that this should be a DNS name.

<host architecture>

Specifies the host's architecture.

<$LEGION>

Specifies the Legion environment variable on the rsh host.

<$LEGION_OPR>

Specifies LEGION_OPR for host.

<$LEGION_OPA>

Specifies the OPR address for the object, i.e, a unique directory in which the object will maintain its persistent representation on the remote host.

<binary path>

Binary executable path for the object on the remote host.

Optional parameters do the following:

<user id>

Specifies the appropriate user name on the rsh host.

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_deactivate_object 
   {[-c] <object context name> | -l <object LOID>} [-debug] [-help]

Deactivates the object named in <object LOID> or <context path> (moves it to an inert state) if it is currently active. If the object is already inactive, the command has no effect.

The following options are supported:

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_destroy_object 
   {[-c] <object context name> | -l <object LOID>} [-debug] [-help]

Deletes the object named in <context path> or <object LOID>. More specifically, it removes the object's LOID but not its context name (if there is one). If the object is active, the command deactivates the object. In all cases, it deletes the OPR (object persistent representation) associated with the object.

This command will not remove any context name associated with the object: you must use the legion_rm command to remove the object's name(s) or you will get binding errors. (You can use legion_ls -A to check for multiple context names.)

The following options are supported:

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_list_implementations 
   [-v] {[-c] <class context name> | -l <class LOID>} [-debug] [-help]

Lists the implementation objects associated with the class named in <class LOID> or <class context path>. In its default setting the output will consist of each implementation object's LOID and architecture type.

The following options are supported:

-v

Run the command in a verbose setting. The output will include byte size and a brief description of each object. Legion will use one extra method invocation per implementation object.

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_list_instances 
   {[-c] <class context name> | -l <class LOID>} [-debug] [-help]

Displays information about the instances of the class named by <context path> or <class LOID>. For every instance, the tool displays the class's LOID, current object address, status (active or inert), the host on which it resides, and the vault that holds its OPR. The example below shows that class BasicFileClass has two instances, and that both are currently running.

$ legion_list_instances /class/BasicFileClass
Class 1.01.66000000..000001fc0d63e97... knows about the following instances:
LOID: 1.01.66000000.01000000.000001fc0a00...
     Current oa  : [xxx.xxx.xxx.xxx: 2020]
     Current host: 1.01.07.30232908.000001fc0...
     Current vault: 1.01.03.2e232908.000001fc0...
     Status     : object-running
LOID: 1.01.66000000.02000000.000001fc0edd...
     Current oa : [xxx.xxx.xxx.xxx: 1895]
     Current host: 1.01.07.31232908.000001fc0...
     Current vault: 1.01.03.2e232908.000001fc0...
     Status     : object-running
$

The following options are supported:

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_set_host 
   {[-c] <instance context path> | -l <instance LOID>} 
   {[-c] <host context path> | -l <host LOID>} [-debug] [-help]

Calls the set_host() class-mandatory member function on the class of the instance named by in <instance LOID> or <instance context path>, causing the instance to migrate to the host named in <host LOID> or <host context path>.

In the example below, object Foo's host is changed from BootstrapHost to newHost.

$ legion_set_host -c Foo -c /hosts/newHost

The following options are supported:

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_set_vault 
   {[-c] <instance context path> | -l <instance LOID>} 
   {[-c] <vault context path> | -l <vault LOID>} [-permanent]
   [-debug] [-help]

Migrates the state (OPR) of the object named in <instance LOID> or <instance context path> to the vault named in <vault LOID> or <vault context path>.

The following options are supported:

-permanent

Makes the migration permanent. I.e., the object's acceptable vault list will be change to list only the new vault. No further migration can occur without user intervention (via the legion_instance_vault_list command)

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

Be careful with the -permanent flag. If none of the instance's acceptable hosts match the chosen vault (i.e., there are no compatible host-vault pairs) the instance cannot be reactivated. Alternatively, the chosen vault may be compatible only with hosts for which the class has no implementation.

Please note that this command can fail for many reasons, including:

  • the instance does not exist
  • the user does not have permission to perform the migration
  • the target vault does not exist
  • the target vault will not grant the request to create a new OPR for the object
  • the source vault is unavailable or will not grant the request to get the current OPR
  • other machine or system failure
  • the specified vault is unacceptable

The class object will enforce the current restrictions on its instance's acceptable vaults before it migrates the object's state. You may need to change the instance's list of acceptable vaults (via the legion_instance_vault_list command) to include the target vault before running legion_set_vault.

This command is not exactly the equivalent of a true object migration, since the object is not reactivated after its state is moved. Where the object reactivates depends on the scheduling decision made at the time the reactivation occurs. If the -permanent flag is not used and the instance's acceptable vault list is not otherwise altered, future activations of the instance may be on different vaults. If the -permanent flag is used, all future activations must use the specified vault, until the acceptable vault list is altered.

2.3 Calls on LegionClass

legion_add_class_mapping 
   <metaclass LOID> <class LOID> [-debug] [-help]

This command notifies LegionClass that the meta-class named by <metaclass LOID> is the class of the class named by <class LOID>. LegionClass updates its class map accordingly.

The following options are supported:

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_combine_domains 
   [-v] <list of domain cookie files> [-debug] [-help]

Joins a set of Legion domains (systems) to create a single, larger, multi-domain Legion system. Before you run this command, you must obtain a copy of the Legion domain cookie files from all of the involved domains (see legion_generate_domain_cookie and legion_ print_domain_cookie), including the current Legion domain. If you are joining domain A to domain B and domain B has already been joined to domain C, you will need cookie files from domains A, B, and C. This provides transitivity in the system join. All three domains will be joined to one another to form a single system. The command is implemented this way to avoid communication failures; if a LOID can be passed to an object (e.g., in a method continuation list), that object should be able to use the LOID for further communication.

Non-transitive or non-reflexive joins would allow communication of LOIDs for which an object could not obtain a binding. For example, object X in domain A might be able to bind to object Y in domain B and pass a method to it, but object Y might not be able to bind to object X to pass it the return value.

In addition to joining the binding trees of the involved domains, legion_combine_domains also creates context links in the current domain's context space to all of the remote domains' root contexts. These links appear in local context space in the following path: /domain/LegionDomain.<domain-id>.

If the command is run on domains that are already connected, it has no affect and is harmless.

There is currently no mechanism supporting "unjoining" of domains. However, Legion security mechanisms (e.g., ACLs) can be used to effectively forbid any use of the current domain by outside domains.

The following options are supported:

-v

Provide a verbose output as the command is running.

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

The example below combines two domains. If either had previously been connected to another domain, three cookie files would be listed.

$ legion_combine_domains LegionDomainCookie.35d82a07 \ 	
	LegionDomainCookie.c8
Created 2 new domain interconnections
$
legion_create_implementation 
   <binary path name> <architecture> 
   {[-c] <class context name> | -l <class LOID>} 
   [[-c] <object context path>] [-nc] [-v] [-a <attribute>] 
   [-debug] [-help]

Creates an implementation object based on the binary executable named in <binary path name>. Each class maintains a list of the implementation objects that are suitable for its instances. There are a set of implementation objects created when your system was initialized (use legion_ls -la /impl to see a list). Several different implementation objects might be maintained by a class to support the use of multiple platforms--a class might have implementation objects for different architectures, for different operating systems, with different memory requirements, etc.

The new implementation object is associated with the class object named in <class LOID> or <class context path>, and is marked as usable for hosts of a specified type (linux, solaris, etc.). For example,

$ legion_create_implementation \
  Legion/bin/linux/my_obj linux my_class

creates a new implementation object for my_obj. The new object is automatically assigned the context path /impls/my_obj.linux.1 (if you ran the example a second time, the new object would be called /impls/my_obj.linux.2). You can use the -c <object context path> flag to specify a different context path or the -nc flag to specify that no context path be assigned.

At the moment, possible <architecture> values are:

  • solaris (corresponds to Sun workstations running Solaris 5.x)
  • sgi (corresponds to SGI workstations running IRIX 5.x)
  • linux (corresponds to x86 running Red Hat 5.x Linux)
  • x86_freebsd (corresponds to x86 running FreeBSD 3.0)
  • alpha_linux (corresponds to DEC Alphas running Red Hat 5.x Linux)
  • alpha_DEC (corresponds to DEC Alphas running OSF1 v4)
  • rs6000 (corresponds to IBM RS/6000s running AIX 4.2).
  • hppa_hpux (corresponds to HPUX 11)
  • winnt_x86 (corresponds to Windows NT 4.0)
  • t90 (corresponds to Cray T90s running Unicos 10.x)2
  • t3e (corresponds to Cray T3E running Unicos/mk 2.x)

The following optional parameters are supported:

[-c] <context path>

Specify a context path for the new object. Default is /impls/<binary_name>.<architecture>.<#>

-nc

Specify that the new object have no context name.

-v

Run the command in verbose mode.

-a <attribute>

Assign the new object an extra attribute.

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_generate_domain_cookie 
   [-o <cookie output filename>] [-debug] [-help]

Generates a domain cookie file for the current Legion domain, as required by legion_combine_domains. A cookie file contains binding information for the LegionClass in the current domain, security credentials for joining to the current domain, and information about the context space of the current domain (for creating interdomain context space links). The default cookie file name is LegionDomainCookie.<domain-id>, or you can use the -o flag to specify a name. In a secure environment, you must be logged in as /users/admin for the current domain. This ensures that the required credentials can be generated and saved in the cookie file.

The following optional parameters are supported:

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_init_arch [-debug] [-help]

Creates and registers implementation objects for commonly used classes in the current architecture. This command is run on a new host to create its implementation objects in the proper place. Implementation objects for specific binary executables can be created with the legion_create_implementation utility.

$ legion_init_arch
Initializing Legion implementations for "linux"

Creating an implementation (ContextObject) for ContextClass
Continue (y=yes, Y=yes to all, n=no, N=no to all, v=verbose,
 	V=verbose all)? Y
Creating an implementation (MetaClassObject) for LegionClass
Creating an implementation (ClassObject) for VanillaMetaClass
Creating an implementation (BindingAgent) for BindingAgentClass
Creating an implementation (BasicFileObject) for BasicFileClass
Creating an implementation (ttyObject) for ttyObjectClass
Creating an implementation (StatTreeObject) for StatTreeClass
$

The following options are supported:

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_list_domains [-debug] [-help]

List the domains currently connected to your current Legion domain. The output will list the binding for your current domain and any domains linked to your current domain. Please see legion_combine_domains for information about connecting Legion domains.

The following options are supported:

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_print_domain_cookie
   [-i <cookie input file>] [-debug] [-help]

Displays the contents of a Legion domain cookie file (required for using legion_combine_domains). By default the command displays the contents of the file LegionDomainCookie.<current-domain-id>, but any input file name can be specified using the -i option.

The following options are supported:

-i <cookie input file>

Specify the path of the cookie file to print.

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

2.4 Calls on file and context objects

legion_activate_instances 
   {[-c] <class context name> | -l <class LOID>} [-debug] [-help]

Activates all instances of the class named in <class context path> or <class LOID>. Instances that are already active will be unaffected.

The following options are supported:

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_cat 
   <context path1> <context path2> ... <context pathN> 
   [-debug] [-help]

Prints the contents of the Legion file object(s) named in <context path> to standard output. It is similar to the Unix cat command.

$ legion_cat newFileObject
blah, blah, blah.
$

The following options are supported:

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_cd 
   <context path> [-debug] [-help]

Changes the current working context to the context named in <context path>. Note that the path name can be relative or absolute. This command is identical to the legion_set_context command and analogous to the Unix cd command.

The following options are supported:

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_context_add 
   <object LOID> <context name> [-debug] [-help]

Adds a new name <context name> for the object named in <object LOID> to the current context space.

The following options are supported:

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_context_create 
   <context path> [-debug] [-help]

Creates a new context in Legion context space, and assigns it the name given in <context path>. This command is analogous to the Unix mkdir command. The new context will be placed in your current context. The output will contain the new context's location and its LOID.

The following options are supported:

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_cp 
   [-r] [-v] [-m] [-p] [-localsrc] [-localdest]
   [-V <vault context path>] <source path> <destination path> 
   [-debug] [-help]

Copies the file object or tree named in <source path> (named as either a context path or a local path) to a new, duplicate, file object or tree named in <destination path> (named as either a context path or a local path). Use the recursive mode (-r) to export objects to local file space. Analogous to the Unix cp command.

The following optional parameters are supported:

-v

Verbose mode. Prints information about which files and directories the command is currently working on.

-r

Recursive mode. If the <source path> is a directory, all of its contents are copied recursively. Only files and contexts/directories are handled. If other objects are encountered, they are skipped and legion_cp prints a warning message. Note that recursive mode automatically detects cycles in context space and prevents the recursive copy from revisiting context nodes in the cycle. A warning message is printed in the event that cycles are detected.

-localsrc

Local source mode. Use to indicate that the file or directory to be copied (<source path>) is in the local file system. By default the <source path> is assumed to be in Legion context space.

-localdest

Local destination mode. This option indicates that the <destination path> is in the local file system. The path is assumed to be a Legion context path.

-V <vault context path>

Specify a vault restriction for new objects created by this command. Supply the context path of the vault that should manage new objects created as legion_cp runs.

-m

Match-class mode. This mode indicates that when files or contexts are created by this command, they should match the class of their source context or file. By default, new files and contexts are created using the default file and context classes for your current Legion environment. This mode can only be used when copying within Legion context space (i.e., without -localsrc or -localdest).

-p

Print out the size, transfer time, and transfer rate for each file copied.

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_deactivate_instances 
   {[-c] <class context name> | -l <class LOID>} [-debug] [-help]

Deactivates all instances of the class named in <class context path> or <class LOID>. Instances that are already deactivated will be unaffected.

The following options are supported:

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_destroy_instances 
   {[-c] <class context name> | -l <class LOID>} [-debug] [-help]

Destroys all instances of the class named in <class context path> or <class LOID>. Any active instances are deactivated.

This command will remove the LOIDs of the specified class' instances in all contexts, not just the current context. However, it will not remove any context name associated with this object: you must use the legion_rm command to remove the object's name(s), or you will get binding errors. (You can use legion_ls -A to check for multiple context names.)

The following options are supported:

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_direct_output 
   {[-c] <object context path> | -l <object LOID>}
   {[-c] <tty context path> | -l <tty LOID>} [-debug] [-help]

Causes the object named in <object path> or <object LOID> to direct its output (standard out and standard error) to the Legion tty object named by <tty context path> or <tty LOID>. Note that this command can only be invoked on objects that have dynamic output redirection enabled. If the command is invoked on an object that does not have redirection enabled, neither the object nor the tty is affected and an error message is displayed.

The following options are supported:

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_export_dir 
   [-v] [-fc] [-cc] 
   <local base directory path> <target base context path> 
   [-debug] [-help]

The legion_export_dir command allows a complete directory tree in the local file system to be linked into Legion context space without requiring the creation of file copies. A new context will be created to match the local directory tree, and new context names will match the local directory's file names. The command executes only during the duration of time that you wish to use the exported files and directories: if you pause the command the tree's context space will not be available. Once you resume the command, the context will be available.

This is a temporary, read-only context: any changes that you make to the new context, such as changing or removing context names, will not be reflected in the local directory tree (and vice versa). For best results, do not make any changes to the exported directory tree or to the tree's context. For this same reason you should delete the tree's context space when you are finished.

To pause the command, press ^-C. To resume using the exported files, re-execute the command, specifying the same local base directory path and target context path. Use of exported files and directories while the command is not active will cause binding errors. The context space will not be automatically removed when the command is paused or stopped. To delete an exported directory tree's context space, use legion_rm -r while legion_export_dir is active.

The following options are supported:

-v

Verbose mode. Prints information about which files and directories the command is currently exporting.

-fc

Specify the context path of the file object class. This class should be an instance of the metaclass /class/ProxyBindingMetaClass, since the style of file object used by legion_export_dir requires specialized binding services. The default is /class/FileProxyClass.

-cc

Specify the context path of the class to use for context objects. This class should also be an instance of /class/ProxyBindingMetaClass. The default used is /class/ContextProxyClass.

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_get_host 
   {[-c] <object context name> | -l <object LOID>} [-debug] [-help]

This command looks up and returns the LOID of the host on which the object named in <object context path> or <object LOID> currently resides.

$ legion_get_host Foo
1.01.07.d49d1a40.000001fc0c04724...
$

The following options are supported:

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_get_vault 
   {[-c] <object context name> | -l <object LOID>} [-debug] [-help]

Returns the LOID of the vault which the object named in <object context path> or <object LOID> is currently using to store its OPR.

The following options are supported:

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_import_tree 
   [<unix directory path> [<legion context path>]] [-debug] [-help]

Recursively copies a local directory tree in Unix space, named by <unix directory path>, into a Legion context, named by <legion context path>. The output will include the new context's LOID and location. Pathnames can be relative or absolute. Default values are the current working directory and the current working context.

The following options are supported:

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_list_names 
   {[-c] <object context name> | -l <object LOID>} [-debug] [-help]

Lists all of the given object's context names. This includes names assigned by other users. The following options are supported:

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_ln 
   <context path> <new alias> [-debug] [-help]

Assigns an additional name, given in <new alias>, to the object named in <context path>. Analogous to the Unix ln command. Path names can be relative or absolute.

An object can have multiple context names, assigned by one or more users. The same context name can be assigned to different objects or to the same object so long as the contexts names are in different contexts (just as the same file names can be used in different levels of a Unix directory).

The following options are supported:

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_ls 
   [-laLRAdqv] <context path> [-debug] [-help]

Lists the contents of a named Legion context in ascii-alphabetical order. Note that the pathname can be relative or absolute. The command is analogous to the Unix ls command. The default setting lists the current context. You can include a context path in the <context path> parameter to list the contents of that context. For example:

$ legion_ls /hosts
BootstrapHost
my.host.DNS.name
$

You can get more specific information (object type, LOID, other context aliases, state) about objects with the flags. For example, you can get more information about a particular context's objects with the -l, -a, and -A flags. The output below shows a complete list of all objects listed in this context, the objects' types, and any context aliases associated with each listed object.

$ legion_ls -laA /hosts
. 	(context)
     /hosts
..	(context)
     /class/..
     /hosts/..
     /vaults/..
     /home/..
BootstrapHost	(object)
     /hosts/BootstrapHost
     /hosts/host.DNS.name
host.DNS.name	(object)
     /hosts/BootstrapHost
     /hosts/host.DNS.name
$

According to this, there are four names listed in /hosts, two referring to contexts and two to objects. We can see from the alternative context names, though, that BootstrapHost and my.host.DNS.name refer to the same object.

Optional parameters do the following:

-l

List object type and information, if available. Objects of unknown type will be listed as object and faulty objects will be listed as not available.

-a

List "hidden" objects in the context, i.e. those objects whose names begin with a "." character. Examples would be the "." (current) and ".." (parent) contexts.

-L

List the LOID associated with each entry.

-R

Print a recursive list of the current context.

-A

List all known context aliases for each listed object.

-d

List contexts like other objects, rather than listing their contents.

-q

When creating a long list, do not activate inactive objects.

-v

Run command in verbose mode.

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_mkdir 
   <context path> [-debug] [-help]

Creates a new context in Legion context space, and assigns it the name given in <context path>. This command is analogous to the Unix mkdir command (it is also identical to the legion_context_create command). The new context will be placed in your current context. The output will contain the new context's location and its LOID.

The following options are supported:

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_mv 
   <context path> <new context path> [-debug] [-help]

Assigns a new context name, given in <new context path> to the object named in <context path>. Pathnames can be relative or absolute. Analogous to the Unix mv command.

The following options are supported:

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_pwd
   [-debug] [-help]

Prints your current context path. Similar to the Unix pwd command. The following options are supported:

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_rm 
   [-r] [-f] [-v] <context path list> [-debug] [-help]

Removes the context path[s] named in <context path list> from Legion context space. Pathnames can be relative or absolute. Analogous to the Unix rm command.

If the context path listed is the last (i.e., only) name mapped to a given object, the object will be destroyed.

Optional parameters do the following:

-r

Recursively remove one or more contexts and all of their contents.

-f

Force faulty objects (those with bad bindings) to be removed.

-v

Run this command in a verbose setting. This will indicate when objects are destroyed and when only names are being destroyed.

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_set_context 
   <context path> [-debug] [-help]

Changes the current working context to the context named in <context path>. Note that the path name can be relative or absolute. Analogous to the Unix cd command.

The following options are supported:

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_set_tty 
   <tty context path> [-debug] [-help]

This command will set an environment variable to indicate which tty object should be used by subsequent programs. By selecting a new current tty object, users can redirect the output to any window or file.

$ legion_set_tty /context_path/my-tty

Note that program output does not have to be directed to the same window in which the program is run. By setting a new current tty object, the output can be redirected to any window, or even a file. For example:

$ legion_create_object -c /class/ttyObjectClass my-tty
$ legion_set_tty /log-file

creates a tty object whose output is sent to a file. To view the tty output, use the legion_tty_watch command (below).

The following options are supported:

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_tty 
   <tty context path> [-debug] [-help]

This command can be used to direct all output from a particular shell back to that shell -- i.e., create and set a tty object for a shell -- in one step, rather than running legion_create_object, legion_set_tty, and legion_tty_watch. If no tty object exists at the path named in <tty context path> it creates a new object, sets it as the target tty, and starts the legion_tty_watch process in the background of the shell in which the command was run. If a tty object already exists at the named context path, the command sets that tty object as the target.

The following options are supported:

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_tty_off
   [-debug] [-help]

Unsets (stops) the Legion tty object for the current shell so that Legion programs executed in that shell after legion_tty_off is run will not display their output to a Legion tty object. This command also shuts off the background legion_tty_watch process for the current shell. This command only works on tty objects that have been set with the legion_tty command. See legion_tty_watch for information on turning off other tty objects.

Note that this does not destroy the tty object. The object can be reused with legion_tty, legion_set_tty, or legion_tty_watch.

The following options are supported:

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_tty_redirect 
   <object context path> [-debug] [-help]

Causes the Legion tty object currently set in the shell environment to stream directly into the file object named in <object context path>. If the file does not already exist the system creates it. Existing files are appended to, not truncated. A single tty object can be simultaneously directed into any number of files (as well as watched from any number of terminal windows).

The following options are supported:

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_tty_unredirect 
   <object context path> [-debug] [-help]

Causes the Legion tty object currently set in the shell environment to stop streaming into the file object named in <object context path>. If the tty object is not currently directing output to the named file the command is ignored.

The following options are supported:

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_tty_watch 
   [[-c] <tty context path> | -l <tty LOID>] [-debug] [-help]

Causes output written to a Legion tty object to be printed to standard output. If no command line parameters are specified, the current tty object set for the shell session is selected. Otherwise, the tty object named in <tty LOID> or <tty context path> is selected. Note, the command will not self-terminate: to stop the program send it a SIGINT (i.e., using ^C or "kill -INT"). Any number of legion_tty_watch sessions may simultaneously watch the same Legion tty object.

The following options are supported:

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

2.5 Start-up and shutdown functions

legion_add_host_account
   {-l <host object LOID> | [-c] <host object context path>}
   <Unix user id> [-l <owner LOID> | [-c] <owner context path>]
   [-debug] [-help]

This command is used on PCD host objects. Adds a mapping between a Legion account and a Unix account and adds this mapping to a PCD host object's list of available accounts. The user's Unix user id is named in the <Unix user id> parameter. The host object is named in the <host object LOID>/ <host object context path> parameter. The user's Legion user id can be given in the <owner LOID>/<owner context path> parameter.

The following options are supported:

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_create_class 
   [[-c] <context path>] [-sc <scheduler context path>] 
   [-sl <scheduler LOID>] [-debug] [-help]

Creates a new instance of class VanillaMetaClass. The object will be placed in the current working context, unless specified with the -c flag. The following options are supported:

[-c] <context path>

Assigns the context name in <context path> to the new instance.

-sc <scheduler context path>

Specify the context path of the default scheduler object that the new class should use.

-sl <scheduler LOID>

Specify the LOID of the default scheduler object that the new class should use.

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_destroy_host 
   [-v] {[-c] <host context path> | -l <host LOID>} [-debug] [-help]

Destroy a given host object. All contexts objects on that host will be destroyed and all active objects will be deactivated. Legion will automatically search your context space and remove any dangling context names for the host object.

Optional parameters do the following:

-v

Run in verbose mode.

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_destroy_vault 
   {[-c] <vault context path> | -l <vault LOID>} [-debug] [-help]

Destroy a given vault object. Legion will attempt to move all of the vault's current OPRs off of the vault object and then destroy the vault object. If any OPRs cannot be successfully moved the process will abort and an error message will be displayed.

The following options are supported:

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_initialize
   [-debug] [-help]

Populates the Legion system with basic classes and implementations. This command should be run after a Legion system is started for the first time (using legion_startup). On subsequent activations of the system, the state created by this utility will already exist, so this command should not be run again.

The following options are supported:

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_list_host_accounts
   {-l <host object LOID> | [-c] <host object context path>}
   <user id> [-debug] [-help]

This command is used on PCD host objects. It removes one or more account mappings from the host object's list of available accounts. The <user id> parameter is the user's Unix user id. If no host is named in the <host object LOID>/<host object context path> parameter, your current host object will be the default host.

The following options are supported:

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_make_setup_script 
   [-o <script basename>] [-OPR <OPR dir name>] 
   [-L <$LEGION dir name>] [-debug] [-help]

Generates a Legion setup script for your system. This script sets the environment variables for Legion users. The following options are supported:

-o <script basename>

Specify the basename for the resulting setup scripts (default is /home/xxxx/ OPR/setup). This command will generate two setup scripts, one for /bin/sh derivative users and one for csh-derivative users. The scripts will be named <script basename>.sh and <script base-name>.csh, respectively.

-OPR <OPR dir name>

Specify the OPR directory name that will be set up when the resulting scripts are run. This directory will contain the user's local copy of Legion-Class.config (default is "Legion-OPR"). The user's local version of the directory will be placed in the user's $HOME.

-L <$LEGION dir name>

Specify the value of $LEGION, which is the directory where the resulting scripts are run. The default is the current value of $LEGION.

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_print_config
   [-debug] [-help]

Prints the "well-known" binding for LegionClass in the current Legion configuration. The following options are supported:

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_remove_host_account
   [-l <host object LOID> | [-c] <host object context path>]
   [-debug] [-help]

This command is used on PCD host objects. It lists the available accounts on a host object. If no host object argument is provided, your current host object will be used as a default.

The following options are supported:

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_setup_state 
   [-i] [-debug] [-help]

Creates OPRs for the basic Legion system objects. This script should be run when starting a Legion system for the first time. The following optional parameters are supported:

-i

run the command in an interactive mode.

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_shutdown 
   [-local] [-f] [-i] [-debug] [-help]

Shuts down a running Legion system, preserving the state of all objects for subsequent reactivation of the system. Optional parameters allow users to shut down individual hosts and to specify an interactive shutdown.

Optional parameters do the following:

-local

Shut down only a local host or vault.

-f

Force the termination of a system. This may leave processes running, however, and prevent a system restart.

-i

Put the shutdown in an interactive mode, which provides prompts for user actions.

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_shutdown_class 
   {[-c] <class context name> | -l <class LOID>} [-debug] [-help]

Deactivates the class object named in <class LOID> or <context path> and all of its instances. This command operates recursively: if applied to a metaclass, for example, it would deactivate the metaclass, all of its class instances, all of their instances, etc.

The following options are supported:

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_starthost 
   [-L <$LEGION>] [-O <$LEGION_OPR>] [-A <$LEGION_ARCH>] [-B <path>]
   [-N <context name>] [-U <user id>] [-C <host class>]
   {<new host name>} [<compatible vault list>] [-debug] [-help]

Creates a new host object on the specified <new host name>, using the legion_create_object_r command, automatically invoked on the host class). The <new host name> is the host's DNS name. The legion_starthost command selects the following default values for the new object:

<$LEGION_OPA>

= $LEGION_OPR/Host-$HOST.OPA

<binary path>

= $LEGION/bin/$LEGION_ARCH/UnixHostObject

This command uses remote shell (rsh or ssh) classes to start a new host object on a specified host. Please note that you must be able to run rsh/ssh on the target host from your current machine without having to enter a password. You can set up an .rhosts file for rsh or an authorized_keys file for ssh to accomplish this: see the rsh and ssh man pages for further information.

You can run Legion commands on a remote host using rsh or ssh, once you set the proper environment variables. For sh, ksh, or bash, use:

LEGION_RSH=<rsh|ssh>
LEGION_RCP=<rcp|scp>
export LEGION_RSH LEGION_RCP

For csh, use:

setenv LEGION_RSH <rsh|ssh>
setenv LEGION_RCP <rcp|scp>

Optional parameters do the following:

-L <$LEGION>

Specify $LEGION for host (default is "/home/Legion").

-O <$LEGION_OPR>

Specify $LEGION_OPR for host (default is current $LEGION_OPR).

-A <$LEGION_ARCH>

Specify the architecture type for the host (default is current $LEGION_ARCH).

-B <path>

Specifies the basename of the executable host program that will be started on the target host (default is "UnixHostObject").

-N <context name>

Specify the context name for the host object (default is /hosts/<host name>).

-U <user id>

Specify the user id for host (default is current user id).

-C <host class>

Specify the context path of the host class to use (default is /class/UnixHostClass).

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_startup 
   [-local] [-debug] [-help]

Starts up basic Legion services. The following optional parameters are supported:

-local

starts up only a local host or vault.

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_startvault 
   [-L <$LEGION>] [-O <$LEGION_OPR>] 
   [-A <$LEGION_ARCH>] [-N <context name>] 
   [-U <user id>] {<host name>} [<compatible host list>] 
   [-debug] [-help]

Creates a new vault object on the specified <host name>, using the legion_create_object_r command (automatically invoked on the host class). The <host name> is the host's DNS name.

This command uses remote shell (rsh or ssh) classes to start a new vault object on a specified host. Please note that you must be able to run rsh/ssh on the target host from your current machine without having to enter a password. You can set up an .rhosts file for rsh or an authorized_keys file for ssh to accomplish this: see the rsh and ssh man pages for further information.

You can run Legion commands on a remote host using rsh or ssh, once you set the proper environment variables. For sh, ksh, or bash, use:

LEGION_RSH=<rsh|ssh>
LEGION_RCP=<rcp|scp>
export LEGION_RSH LEGION_RCP

For csh, use:

setenv LEGION_RSH <rsh|ssh>
setenv LEGION_RCP <rcp|scp>

The following optional parameters are supported:

-L <$LEGION>

Specify $LEGION for the vaults host. Default is "/home/Legion".

-O <$LEGION_OPR>

Specify $LEGION_OPR for the vaults host. Default is "/home/OPR".

-A <$LEGION_ARCH>

Specify the architecture of the vaults host. Default is current $LEGION_ARCH.

-N <context name>

Specify the context name for the vault object. Default is /vaults/vault-<host name>.

-U <user id>

Specify the user id to use on the vaults host. Default is current user id.

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

2.6 Scheduling support

legion_class_host_list 
   [[-c] <class context name> | -l <class LOID>]
   [{-a | -d | -t} <host1> <host2> ... <hostn>] 
   [-p] [-debug] [-help]

Manipulates the list of hosts upon which the class named in <class context path> or <class LOID> can place its instances. The list of acceptable hosts for a given class consists only of hosts that have been added to the list. The list therefore may not necessarily include all possible hosts. If there are no hosts listed as acceptable the user can assume that all hosts are acceptable.

Note also that if you identify the class by its context name in the first parameter (i.e., myClass) you must use the hosts' context names in the [<host1> <host2> ... <hostn>] parameter. Similarly, if you name the class by its LOID (with the -l flag) you must use the hosts' LOIDs. If you were to enter:

$ legion_class_host_list /class/myClass -t 1.01.07.d59d...

You would get an error message. Legion will treat the host's LOID as a context name.

The example below adds a new host to the list of acceptable hosts of BasicFileClass, using the -A flag.

$ legion_class_host_list /class/BasicFileClass \
   -a  /hosts/newHost
** ADDED 1 host(s) to class's acceptable host set

The -p flag can then be used to check the listing.

$ legion_class_host_list /class/BasicFileClass -p
** ACCEPTIBLE HOST LISTING: 
**   1.01.07.d59d1a40.000001fc094e23...
$

The following optional parameters are supported:

-l

Use dotted hex LOIDs to specify class and host.

-a

Add named host to the class's acceptable host list.

-d

Delete named host from the class's acceptable host list.

-t

Test whether or not a host is on the class's acceptable host list.

-p

Display the class's acceptable host list.

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

You can use the -a, -d, and -t flags more than once when running the command but regardless of how you list them on the command line Legion will process them in a specific order when you run the command: first adding any new hosts, then deleting old hosts, then testing any hosts, and finally printing out the results.

legion_class_vault_list 
   [[-c] <class context path> | -l <class LOID>}
   [{-a | -d | -t} <vault1> <vault2> ... <vaultn>] 
   [-p] [-debug] [-help]

Manipulates the list of vaults upon which the class named in <class context path> or <class LOID> can place its instances' OPRs. Note that if you identify the class by its context name in the first parameter (i.e., myClass) you must name the vaults by their context names in the [<vault1> <vault2> ... <vaultn>] parameter. Similarly, if you name the class by its LOID (with the -l flag) you must use the vaults' LOIDs. If you were to enter:

$ legion_class_vault_list /class/myClass -t 1.01.07.01000...

You would get an error message. Legion will treat the vault's LOID as a context name.

Optional parameters are:

-l

Use LOIDs to specify class and vault.

-a

Add named vault to the class's acceptable vault list.

-d

Delete named vault from the class's acceptable vault list.

-t

Test whether or not a vault is on the class's acceptable vault list.

-p

Display the class's acceptable vault list.

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

You can use the -a, -d, and -t flags more than once when running the command but regardless of how you list them on the command line Legion will process them in a specific order when you run the command: first adding any new vaults, then deleting old vaults, then testing any vaults, and finally printing out the results.

legion_config_scheduler 
   {[-c] <scheduler context path> | -l <scheduler LOID>} 
   [-get_enactor] [-get_collection] 
   [-set_enactor {[-c] <enactor context path> | -l <enactor LOID>}] 
   [-set_collection {[-c] <collection path> | -l <collection LOID>}]
   [-debug] [-help]

This command can be used to query or configure the helper objects used by a basic Legion scheduler. Basic Legion scheduler objects use a collection helper object to obtain information about available resources upon which they can schedule objects. After constructing a schedule, basic Legion schedulers use an enactor helper object to implement scheduling decisions (to actually start up the scheduled objects). Use this command to assign a particular collection and enactor to a basic Legion scheduler or vice versa.

The following optional parameters are supported:

-get_enactor

Print the LOID of a basic Legion scheduler's currently assigned enactor helper object.

-get_collection

Print the LOID of a basic Legion scheduler's currently assigned collection helper object.

-set_enactor

Set the enactor named in <enactor LOID> or <enactor path> to the scheduler.

-set_collection

Set the collection named in <collection LOID> or <collection path> to the scheduler.

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

legion_host_vault_list 
   {[-c] <host context path> | -l <host LOID>]
   [{-a | -d | -t} <vault1> <vault2> ... <vaultn>] 
   [-p] [-debug] [-help]

Used to display and manipulate list of vaults with which the host named in <host context path> or <host LOID> can interoperate. Note also that if you identify the host by its context name in the first parameter (i.e., as foo) you must also identify the vaults by their context names in the [<vault1> <vault2> ... <vaultn>] parameter. Conversely, if you name the host by its LOID (via the -l flag) you must identify the vaults by their LOIDs. That is, if you enter:

$ legion_host_vault_list /host/HostName -t 1.01.03.d49...

You will get an error message. Legion will treat the vault's LOID as a context name.

To list the vaults that a host can operate on use the -p flag:

$ legion_host_vault_list /hosts/HostName -p
** COMPATIBLE VAULT LISTING: 
**   1.01.03.d49d1a40.000001fc0a69cbb845...
$

The following optional parameters are supported:

-l

Use dotted hex LOIDs to specify host and vault.