2.1 The Hierarchical Storage Interface Program (HSI)
You interact with HPSS by entering requests through the HPSS Interface program (HSI), which runs on the computer that you are using. The request is then parsed and the appropriate internal HPSS requests are issued to accomplish the desired function.

HSI can be used in an interactive session with a response for each request entered at the keyboard; it can also be used in single-line execution mode interactively or within shell scripts, or called from an executing program, using the system() function..

As HSI processes a request, it engages in a network dialogue with various components of the HPSS system. At times, due to network or other activity, it may appear as though HSI is `hung', although internally all functions are issued with timeout and retry logic which will quit after a reasonable time has expired with no response. You, as an interactive user, can take action to stop the continued wait and retry cycle. The actions available depend on which operating system you are using; normally typing ^C (control-C) will cause the current command to be interrupted.


2.2 HSI Command Line
The HSI command line has the following general format:

hsi [options] [command [parameter(s)]] [ ; command [parameters]] ...

In interactive mode, if no commands are encountered, HSI will prompt for input, ending the session when the END command (or one of its aliases) is entered.

HSI can also be used in one-liner mode by placing all of the commands on the startup line, separated by semicolons (";"). Note that it may be necessary to enclose the entire command string in quotes to protect it from interpretation by the shell - see Section 8.7 - Operating Considerations for One-Liners for more information.

In one-liner mode, all commands on the startup line are processed, then HSI terminates execution. This is the normal mode for shell scripts and batch jobs.

Options are used to set initial operating modes for HSI, and are listed below:

[ PAGE TOP ]

2.3 HSI Startup File
When HSI begins execution, it reads the system-wide startup file: /usr/lib/hsirc and the user's private startup file (if it exists): ~/.hsirc

Both of these files are stored in local storage, not in the user's HPSS space. HSI also will look for a startup file in the user's HPSS home directory after authentication has completed successfully. However, it is not recommended that users create a ~/.hsirc file in their HPSS home directory; if this file is migrated to tape and purged from disk, then the HSI startup process will take a long time, particularly if there is contention for tape drives within HPSS.

Startup files are used to contain startup options for HSI. Input lines in the file consist of comments and directives.

For example, to set the default prompt to the current HPSS working directory, followed by the string "->", the following line could be inserted in the .hsirc file:
     PS1 = "%W->"

[ PAGE TOP ]


2.4 What is an HSI Request?

An HSI request is your input to HPSS to accomplish a desired function. You sign on to a computer and run the HSI utility program to communicate with HPSS. HSI can be used interactively, but it can also be used in single-line execution mode or called from an executing program or a command-language script (for example, as part of a batch job).

You start HSI by entering

    hsi <return>

After login validation has completed, you will receive any startup messages and the prompt (normally a question mark "? ") indicating that HSI is ready to accept input. (See the PS1 keyword, and the .hsirc startup file for info on changing the prompt string).

You can then enter HSI commands. When you are ready to finish, enter

    quit <return>

(Note that there are aliases for the "quit" command, such as "end", which will all cause HSI to terminate.)

[ PAGE TOP ]


2.5 HSI Request Format

The basic format for all HSI requests is
COMMAND parameter KEYWORD=value ...
where HSI returns a response to indicate the success or failure of your request and a prompt for the next input. See Chapter 8, Commands, Keywords, and Parameters, for a complete description of all commands, parameters, and keywords in alphabetical order.

[ PAGE TOP ]


2.6 HSI Response Format

HSI returns a response for each request entered. The response shows whether the request was executed successfully or was not completed due to some error. If an error occurred, the response indicates why the request failed.

The basic format of a normal response is

Error conditions can be detected by HSI as the request is interpreted and executed. The basic format of an error response is

where

Refer to Chapter 4, HSI Responses, for more information about responses and to HSI Return Codes for a listing of HSI error responses.

[ PAGE TOP ]


2.7 HPSS Tree Structures

HPSS supports a hierarchical storage structure called a tree, which consists of segments called nodes: A subdirectory (your home directory) is created for you automatically when you are given an HPSS account. When you use HSI or FTP to login to HPSS, you are automatically placed into this directory to begin your session; you can then store and retrieve files from that directory with simple get or put commands.

A file descriptor node is created when a file is first stored on HPSS. It contains information about the file, such as its size and hierarchy ID, but not the actual file data. File descriptor nodes cannot have descendants.

File trees, when illustrated, are customarily shown as inverted. The root is shown at the top with descendant nodes beneath it. Connecting branches show the relationships between the nodes and the root (see the Simple Tree example). If you need to save only a few files, you can probably use a simple tree (one with no subdirectories). Complex trees (those with subdirectories) are described in Chapter 5: Tree Structures, Directories and Paths

[ PAGE TOP ]


2.8 Paths and Working Directories

To store or retrieve a file in an HPSS tree, you may specify to HSI the complete path from the root node to the file node. The name of each node is preceded by a slash (/) and then chained together from the root downward to form the complete path. The maximum length of each node name is 255 characters. The maximum total path length, including slashes, is 1023 characters.

In the simple tree shown in the Simple Tree example, the complete path to the file "Data1" is

However, you do not have to type in the complete path every time you refer to an HPSS file. Working directories are provided where you can store partial or complete paths. The primary working directory contains your HPSS home directory as a path when you first start the HSI Interface. If a request contains a path without the leading slash, then HSI forms the complete path by combining The following example shows you how user tom (assuming that /u/tom refers to tom's home directory) could retrieve the file Data1.

Example: using the default working directory path name

instead of

There are nine other working directories. Using these directories is optional and requires planning, but they are helpful when dealing with multiple trees or with requests that require two paths. See Chapter 5, Tree Structures, Directories, and Paths, for more information.

[ PAGE TOP ]


2.9 HPSS Security and File Sharing

To execute an HSI command successfully, the user must have access to the affected files or directories as per normal UNIX file systems: HPSS internally uses a number called a User ID, or UID, to identify each user. This number is assigned by the system administrator when you get your account and is used to identify all HPSS nodes which you create.

In addition, you may be placed as a member of one or more administrative groups, each of which is known to HPSS by a Group ID, or GID. When HPSS validates your access rights to files, it takes into account all GIDs of which you are a member. The list of groups to which you belong is also referred to as your group vector.

If you expect to share files with other users, you will need to understand access rights. All files are protected against unauthorized access. You can give other users access through the proper combination of permission bits. See Chapter 6, Security and File Sharing, for more information.

HPSS supports ACLs for multilevel security. However, ACL support is not included in HSI at this time.

[ PAGE TOP ]


2.10 Interactive Use of HSI

Interactive use of HSI involves the following activities: The following example illustrates the interactive use of HSI with one request per line. The request is followed by an explanation of the purpose of the request, and then by the response from HPSS. Note that the HSI prompt has been omitted for clarity and that the logged-on user has user name "bugs" with user id "12345".

Example: interactive use of HSI

[ PAGE TOP ]


2.11 Single-Line Execution

In single-line execution mode (one-liners), the HSI invocation and all the requests are included in one execute line. When a <RETURN> is entered, each request is executed, HSI ends, and control returns to the operating system of the local computer. You can continue request input on a second line with a backslash (\) as the last character of the line, and single-line execution will still be in effect (see Request Format Rules in Section 3.2).

The execute line for single- line execution has the form:

where request1, request2, ..., are HSI requests.

In the following example, the one-liner accomplishes some of the same tasks as the interactive session shown in the previous example. The space following "hsi" and the semicolonss between requests are required. Additional spaces are permitted. The command is placed in double quotes to preclude interpretation by a Unix command shell interpreter program.

Example: single-line execution

The example command line

[ PAGE TOP ]


2.12 Batch Use of HSI
HSI may also be used in scripts and batch files. It may be started from executables via the system() command.

[ PAGE TOP ]