Silicon Graphics, Inc.
OpenVault
Client Application Programming Interface (CAPI)
and
Administrative Application Programming Interface (AAPI)

$Id: AAPI.html,v 1.11 1997/07/01 21:38:19 curtis Exp $

The OpenVault Client Application Programming Interface (AAPI) and the OpenVault Administrative Application Programming Interface (AAPI) are the languages and interfaces that OpenVault client and administrative programs use to communicate with MLM. CAPI and AAPI commands to MLM and responses from it are nominally human-readable ASCII strings.

Access to MLM is session-oriented. The application initiates a session with the hello command, and ends by sending a goodbye command. See the HELLO Language Specification for more detailed information on session initiation. After session initiation the application may send commands to the server to query and modify various pieces of system state information or to exercise physical device control.


CAPI/AAPI Operational Model

The Client/Administrative Application Program Interfaces use a hybrid of an object/attribute interface and function-oriented commands to accomplish all the various tasks that are required in a low-level media-management system.

The CAPI/AAPI command-response format is a semi-asynchronous one. After submitting each command, the application must wait for the server's acknowledgement of receipt of the command, but need not wait for the results of the command before sending the next one.

From the client's point of view of a single command in a session, the sequencing is that the client sends a command, waits for MLM's acknowledgement of receipt of that command, and then sometime later MLM sends the client the response to the command. Since the client is required to put a task identifier on each CAPI/AAPI command, if the client can guarantee that those identifiers are unique within the context of a session, then the application can determine which response goes with which command. A couple example, with real CAPI/AAPI commands, may serve to clarify this idea:

Client sends command (direction of arrow indicates sender-- the right arrow indicates that the client is sending to MLM; the left arrow indicates the reverse):

Client sends command to MLM:

--> mount task["1"] match[streq(VOLUME."VolumeName" "v1")];

MLM sends acknowledgement of receipt:

<-- response task["1"] accepted;

Sometime later, MLM sends response to command:

<-- reponse task["1"] success;

Since the application can determine which response came from the execution of each individual command, the sequence could look something more like this:

--> mount task["1"] match[streq(VOLUME."VolumeName" "v1")];
<-- response task["1"] accepted;
--> attribute task["a43"] match[streq(VOLUME."VolumeName" "v1")] set[VOLUME."Color" "green"];
<-- response task["a43"] accepted;
<-- response task["a43"] success;
<-- response task["1"] success;

Note that in this example, the application sent its second command before the first command had completed execution. In fact, in this particular example, the second command completed its execution before the first.

SGI will provide sample CAPI/AAPI communications libraries which can be used either in a fully synchronous or in the native semi-asynchronous manner.

Objects and Their Attributes

OpenVault defines 34 types of objects that make up a media environment. A complete description of the objects, their attributes, and how they relate to each other is in the OpenVault Object Definitions document.

Relationships Between Objects

OpenVault objects are all related to each other. Some relationships are physical, eg: partitions, sides, and cartridges, or slots, bays, and libraries. And some relationships are logical, eg: applications, volumes, and partitions.

Those relationships must be understood in order to effectively administer the OpenVault environment.

Function Oriented Commands

In addition to objects and their attributes, an administrative application can directly cause some operations to occur. For example, an application can eject a cartridge from a library into an operator's hand.

There is a set of commands in the AAPI language that implement those operations. The objects and the attributes that control them are still active and will influence exactly what happens when one of the operation-oriented commands is executed. For example, the current value of any drive group attributes on the drives in the system will affect an AAPI mount command by influencing which drives are candidates for the mount.

Security Model

The OpenVault security model in general is based around both applications and the limitations of the interface that that application has access to. A normal client application only has access to the CAPI interface, with the limitations in control that that implies: no visibility into other applications's namespaces for volumes, read-only access to drive or library attributes, no ability to directly create or destroy objects, etc. An administrative application has access to the much more powerful AAPI language, implying: read-write access to attributes on any object in the system, and the ability to create and destroy objects.

CAPI client applications are protected from each other, but all AAPI applications share complete access to the entire system. It is expected that in Release 1 of Openvault only trusted applications will be granted access to the AAPI interface.


AAPI Command Descriptions

CAPI/AAPI commands fall into three basic groupings: session management, database manipulation, and device control. (Commands marked with an asterisk (*) are not available to CAPI applications):

Session Management

Database Manipulation

Device Control


Semantics of Common Syntactic Elements

There are several syntactic elements which are common to many AAPI and CAPI commands. These include match[], order[], number[], report[], reportMode[] and others. In the interest of general utility, the meaning of each of these elements is constant no matter which command it is found in.

General Order of Operations for Commands

  1. Start with whole object name space as our work set.
  2. Restrict work set to objects which match specified attribute criteria, using match[] element.
  3. Order the work set by sorting on values of specified attributes, using order[] element.
  4. Select certain ordinal items from the ordered work set using the number[] element.
  5. Report specified attributes from the objects which are in the final work set. The report[] and reportMode[] elements work together to influence the output.

Description of Specific Syntax Elements

The syntax elements described in the sections below are "executed" in the order explained above.

Glossary of match[] Sub-Functions

The following functions operate in the context of the AAPI and CAPI match syntax element. For each possible combination of objects in the system, an expression made up of field references (eg: OBJECT."field") in combination with the following functions is evaluated. If the expression returns false, then the object is not included in with work set for whatever operation the match[] clause is part of.


AAPI Command Examples and Pseudo-Code

What follows is a list of example AAPI commands, each followed by a description of what is does.


Miscellaneous Notes

Character Set and Quoting Considerations

The character set for OpenVault strings includes all 7-bit ASCII characters in the decimal value range 32 to 126. Strings are required to be quoted with either a double-quote or single-quote character. (" or '). OpenVault considers the single quote character and double quote characters to be exactly identical. To include a double- or single-quote character in a string, put a backslash (\) before it in the string. To include a single backslash character in a string, put two backslash characters in your string (as in: "this string actually contains \\ a single backslash character and a quote \" character')

Command Element Ordering

All commands are designed so that the basic elements of the command may be entered in any order.

AAPI Command Return Formats and Values

In general, when a command is successful, the return value specification is the following:

Potential return value types depend on the command issued.

When a command is unsuccessful, the error return value conforms to the following specification:


Complete AAPI Syntax Specification (in modified BNF)

commands goodbyeStmt
attachStmt
detachStmt
allocateStmt
deallocateStmt
renameStmt
rejectStmt
mountStmt
unmountStmt
attributeStmt
showStmt
cancelStmt
responseStmt
createStmt
deleteStmt
injectStmt
ejectStmt
moveStmt
forgetStmt
goodbyeStmt goodbye task [ string ] ;
attachStmt attach attachArgs ;
attachArgs /* empty */
task [ string ] attachArgs
match [ baseMatchSpec ] attachArgs
order [ orderSpec ] attachArgs
report [ listOfObjRefs ] attachArgs
reportmode [ reportMode ] attachArgs
detachStmt detach detachArgs ;
detachArgs /* empty */
task [ string ] detachArgs
report [ listOfObjRefs ] detachArgs
reportmode [ reportMode ] detachArgs
allocateStmt allocate allocateArgs ;
allocateArgs /* empty */
task [ string ] allocateArgs
volname [ listOfStrings ] allocateArgs
match [ baseMatchSpec ] allocateArgs
order [ orderSpec ] allocateArgs
number [ numberSpec ] allocateArgs
report [ listOfObjRefs ] allocateArgs
reportmode [ reportMode ] allocateArgs
deallocateStmt deallocate deallocateArgs ;
deallocateArgs /* empty */
task [ string ] deallocateArgs
volname [ listOfStrings ] deallocateArgs
match [ baseMatchSpec ] deallocateArgs
order [ orderSpec ] deallocateArgs
number [ numberSpec ] deallocateArgs
report [ listOfObjRefs ] deallocateArgs
reportmode [ reportMode ] deallocateArgs
rejectStmt reject rejectArgs ;
rejectArgs /* empty */
task [ string ] rejectArgs
volname [ listOfStrings ] rejectArgs
text [ listOfStrings ] rejectArgs
match [ baseMatchSpec ] rejectArgs
order [ orderSpec ] rejectArgs
number [ numberSpec ] rejectArgs
report [ listOfObjRefs ] rejectArgs
reportmode [ reportMode ] rejectArgs
renameStmt rename renameArgs ;
renameArgs /* empty */
task [ string ] renameArgs
newvolname [ string ] renameArgs
volname [ listOfStrings ] renameArgs
match [ baseMatchSpec ] renameArgs
order [ orderSpec ] renameArgs
number [ numberSpec ] renameArgs
report [ listOfObjRefs ] renameArgs
reportmode [ reportMode ] renameArgs
mountStmt mount mountArgs ;
mountArgs /* empty */
task [ string ] mountArgs
volname [ listOfStrings ] mountArgs
match [ baseMatchSpec ] mountArgs
order [ orderSpec ] mountArgs
number [ numberSpec ] mountArgs
report [ listOfObjRefs ] mountArgs
reportmode [ reportMode ] mountArgs
mountmode [ listOfTexts ] mountArgs
type [ objectName ] mountArgs
unmountStmt unmount unmountArgs ;
unmountArgs /* empty */
task [ string ] unmountArgs
volname [ listOfStrings ] unmountArgs
match [ baseMatchSpec ] unmountArgs
order [ orderSpec ] unmountArgs
number [ numberSpec ] unmountArgs
report [ listOfObjRefs ] unmountArgs
reportmode [ reportMode ] unmountArgs
attributeStmt attribute attributeArgs ;
attributeArgs /* empty */
task [ string ] attributeArgs
volname [ listOfStrings ] attributeArgs
match [ baseMatchSpec ] attributeArgs
order [ orderSpec ] attributeArgs
number [ numberSpec ] attributeArgs
report [ listOfObjRefs ] attributeArgs
reportmode [ reportMode ] attributeArgs
set [ objectRef string ] attributeArgs
unset [ objectRef ] attributeArgs
showStmt show showArgs ;
showArgs /* empty */
task [ string ] showArgs
volname [ listOfStrings ] showArgs
match [ baseMatchSpec ] showArgs
order [ orderSpec ] showArgs
number [ numberSpec ] showArgs
report [ listOfObjRefs ] showArgs
reportmode [ reportMode ] showArgs
cancelStmt cancel cancelArgs ;
cancelArgs /* empty */
task [ string ] cancelArgs
match [ baseMatchSpec ] cancelArgs
order [ orderSpec ] cancelArgs
number [ numberSpec ] cancelArgs
report [ listOfObjRefs ] cancelArgs
reportmode [ reportMode ] cancelArgs
responseStmt response responseArgs ;
responseArgs /* empty */
whichtask [ string ] responseArgs
accepted responseArgs
unacceptable responseArgs
success responseArgs
error [ string ] responseArgs
cancelled responseArgs
text [ listOfStrings ] responseArgs
createStmt create createArgs ;
createArgs /* empty */
task [ string ] createArgs
type [ objectName ] createArgs
set [ objectRef string ] createArgs
report [ listOfObjRefs ] createArgs
reportmode [ reportMode ] createArgs
deleteStmt delete deleteArgs ;
deleteArgs /* empty */
task [ string ] deleteArgs
type [ objectName ] deleteArgs
match [ baseMatchSpec ] deleteArgs
order [ orderSpec ] deleteArgs
number [ numberSpec ] deleteArgs
report [ listOfObjRefs ] deleteArgs
reportmode [ reportMode ] deleteArgs
injectStmt inject injectArgs ;
injectArgs /* empty */
task [ string ] injectArgs
match [ baseMatchSpec ] injectArgs
order [ orderSpec ] injectArgs
number [ numberSpec ] injectArgs
report [ listOfObjRefs ] injectArgs
reportmode [ reportMode ] injectArgs
ejectStmt eject ejectArgs ;
ejectArgs /* empty */
task [ string ] ejectArgs
match [ baseMatchSpec ] ejectArgs
order [ orderSpec ] ejectArgs
number [ numberSpec ] ejectArgs
report [ listOfObjRefs ] ejectArgs
reportmode [ reportMode ] ejectArgs
moveStmt move moveArgs ;
moveArgs /* empty */
task [ string ] moveArgs
fromslot [ string ] moveArgs
frompcl [ string ] moveArgs
toslot [ string ] moveArgs
match [ baseMatchSpec ] moveArgs
order [ orderSpec ] moveArgs
number [ numberSpec ] moveArgs
report [ listOfObjRefs ] moveArgs
reportmode [ reportMode ] moveArgs
forgetStmt forget forgetArgs ;
forgetArgs /* empty */
task [ string ] forgetArgs
match [ baseMatchSpec ] forgetArgs
order [ orderSpec ] forgetArgs
number [ numberSpec ] forgetArgs
report [ listOfObjRefs ] forgetArgs
reportmode [ reportMode ] forgetArgs
orderSpec orderSpecOne orderSpecMore
orderSpecMore orderSpecOne orderSpecMore
/* empty */
orderSpecOne orderOpSpec ( orderMultiSpec
orderMultiSpec matchSpec orderMultiSpecMore
orderMultiSpecMore matchSpec orderMultiSpecMore
)
orderOpSpec strLoHi
strHiLo
numLoHi
numHiLo
baseMatchSpec unaryOpSpec ( matchSpec )
binaryOpSpec ( matchSpec matchSpec )
multiOpSpec ( matchMultiSpec
matchSpec baseMatchSpec
objectRef
string
number
matchMultiSpec matchSpec matchMultiSpecMore
matchMultiSpecMore matchSpec matchMultiSpecMore
)
unaryOpSpec isAttr
noAttr
not
binaryOpSpec regx
streq
strne
strlt
strle
strgt
strge
numeq
numne
numlt
numle
numgt
numge
multiOpSpec and
or
numberSpec numberSpecDouble numberSpecMore
numberSpecSingle numberSpecMore
numberSpecMore numberSpecDouble numberSpecMore
numberSpecSingle numberSpecMore
/* empty */
numberSpecOne number
FIRST
numberSpecDouble numberSpecOne .. number
numberSpecOne .. LAST
numberSpecSingle numberSpecOne
LAST
listOfObjRefs objectRef listOfObjRefs
/* empty */
objectRef objectName . string
objectName AI
APPLICATION
BAY
CARTRIDGE
CARTRIDGEGROUP
CARTRIDGEGROUPAPPLICATION
CARTRIDGETYPE
CONNECTION
DCP
DCPCAPABILITY
DRIVE
DRIVEGROUP
DRIVEGROUPAPPLICATION
LCP
LIBRARY
MOUNTLOGICAL
MOUNTPHYSICAL
PARTITION
REQUEST
SESSION_TABLE
SIDE
SLOT
SLOTCONFIG
SLOTTYPE
SYSTEM
VOLUME
reportMode name
namevalue
value
unique
name unique
unique name
namevalue unique
unique namevalue
value unique
unique value
listOfTexts text [ listOfStrings ] listOfTexts
/* empty */
listOfStrings string listOfStrings
/* empty */
number INTEGER
string STRING

STRING: String of character-set bytes <= 65536 bytes long, surrounded by quotes.

DIGITS: Any string of numeric characters [-][0-9]+ which resolve to a value that can fit in a 32-bit signed integer.


Error symbolic names, error numbers, and associated text

Errors and the Commands that can Encounter Them
Error Command(s)
duplicate object name create
rename
unknown object name show
attribute
delete
rename
mount
unmount
cannot meet "match" specification show
create
delete
attribute
mount
unmount
cannot meet "mountMode" specification mount
read-only attribute attribute
reserved attribute name attribute

Commands and the Errors that can be Encountered by Them
Command Error(s)
show cannot meet "match" specification
unknown object name
attribute cannot meet "match" specification
read-only attribute
reserved attribute name
unknown object name
create cannot meet "match" specification
duplicate object name
delete unknown object name
rename duplicate object name
unknown object name
mount cannot meet "match" specification
cannot meet "mountMode" specification
volume mounted
unknown object name
unmount cannot meet "match" specification
volume not mounted
unknown object name