RAP(8)

NAME

rap - RAP, character-based resource administration program

SYNOPSIS

rap [ -c ] [ -i file ] [ -s server ] [ -p prognum ] [ -v version ] [ query ] ...

rap [ -c ] [ -i file ] -f resfile ... [ query ] ...
rap [ -i file ] -n ndbmfile [ query ] ...

DESCRIPTION
The rap command is a command-line based administrative program for services using the Legato Resource Administration Platform (RAP). The rap command can be used to query and modify resources in four forms: in files, in an ndbm(3) database, talking to a service, or using the RAP Resource Directory, which is the default. There is also a visual mode that uses the curses(3) package to do full screen interactive administration on a character-only terminal.

OPTIONS

-c  Uses the curses(3) package to implement a full-screen display mode, just like the visual command described below.

-i infile
    Takes input commands from infile instead of from standard input. In this mode, the interactive prompt is not printed. The file name - is used to indicate reading from standard input, but without the prompt.

query
    If a query is specified (in the form of an attribute list), the edit operation (see below) is performed on the results of the query. See COMMANDS for more information on how the edit command works.

-s server -p program -v version
    Administers through a connection to the service with the given RPC program number and version number running on the given server machine.

-f resfile
    Administers the RAP resource file resfile as its database of resources. If more than one -f argument is given all of the listed files will be used.

-n ndbmfile
    Administers the ndbm(3) resource database. Used only for debugging.

RESOURCES
Each RAP resource is described by a list of named attributes. Each attribute can have zero or more values. The attribute names and values are all represented by printable strings. Upper and lower case is not distinguished, and spaces are ignored except inside the names and values.

The rules for specifying attributes and attribute lists are:

attribute ::=  name [ : value [ , value]* ]
    An attribute is a name optionally followed by a colon followed by zero or more values, with multiple values separated by commas. A comma at the end of a line continues the line.

attribute list ::= attribute [ ; attribute ]*
    An attribute list is one or more attributes separated by semicolons. A semicolon at the end of a line continues the line. The list is ended by a newline that is not preceded by a comma or semi-colon. Quotes and back-slashes can be used to quote special characters.

Here is an example of an attribute list:

             name: venus;
             type: NSR client;
    remote access: venus, mars;

For more information on attributes, attribute lists, the RAP resource format, and type descriptors, see the resource(5) manual page, or the manual page describing the appropriate resource type.

COMMANDS
In non-visual mode, rap expects a command name and optional arguments at each input prompt. Command names can be shortened to the smallest unique string (for example, p for print). Command arguments are always specified in the form of an attribute list. Most commands operate on a list of resources returned by a query. The query is specified as an attribute list which is used to match resources with the following rules:

    1) If more than one attribute is specified, then the resource must match all attributes.

    2) If more than one value is specified the resource can match any one of the values.

    3) Values in a query may be in the form of ed(1) style regular expressions. A pattern match is attempted against all resources that contain the specified attribute.

    4) If an attribute is specified with no value, then the resource must contain an attribute of that name.

Thus, a query:
    type:NSR device;
    name:mars, venus;
    test
will match all resources that have a type attribute with the value NSR device and a name attribute with a value of either mars or venus, and an attribute test with any value.

If the query has only one name and no values (for example, if there is no semi-colon or colon in it), then the program tries to guess a more reasonable query. If the name is a host name, then the query will select all the resources on the given host. Otherwise, the name will be interpreted as a type name, and all resources of that given type will be selected.

bind [query]
    Bind to the service that owns the resource described by query. If no query is specified, queries are sent to the RAP Resource Directory. Update, create, and delete commands are sent to the service that owns the resource being changed.

create attribute list
    Create a resource with the given attributes. One of the attributes must be type to specify the resource type. The types command can be used to find out which types a server supports. If no particular server is bound, then the location attributes must also be specified to determine where the creation takes place.

delete [query]
    Delete the resources that match the current query. If a query is specified, it becomes the current query.

edit [query]
    Edit the resources that match the current query. If a query is specified, it becomes the current query. If the environment variable EDITOR is set, then that editor will be invoked, otherwise vi(1) will be started. When the editor exits, rap applies update, delete and create operations based on the changes to the resource descriptors. Be careful to not edit the resource identifier attribute, and to write the file out before exiting the editor.

help [command]
    Print a message describing a command. If no command name is given a synopsis of all of the commands is given.

print [query]
    Print the resources that match the current query. If a query is specified, it becomes the current query. If the current show list is not empty only the attributes named in the show list will be displayed.

show [name; ...]
    If a name list (really an attribute list with no values) is specified, add those names to the show list. These attributes will be displayed in subsequent print commands. If no name list is given the show list is cleared, resulting in all visible attributes being shown.

types
    Print a list of all known types.

update attributes
    Update the resources given by the current query to match attributes.

quit
    Exit the program.

visual  [query]
    Enter a full-screen mode using the curses(3) package to step through commands. You can get this mode directly using the -c command line argument.

option [option;...]
    This command enables some options to change the display of resources. With no arguments it displays the current options; with a list of options it turns the specified ones on. Dynamic displays all dynamic attributes, even the normally hidden ones. Hidden displays all attributes, even the normally hidden ones. Resource ID displays the resource identifier on each resource, a number that is used internally to provide sequencing and uniqueness.

unset [option;...]
    This command turns off the specified option.

. [query]
    If a query is specified, this command will set the current query without printing the results of the query. Otherwise, it will display the current query, show list, and server binding.

? [command]
    Same as the help command above.

EXAMPLES

print type:NSR device
    Print all resources of type NSR device and make this the current query.

show type; name
    Set the show list to only display the attributes type and name.

delete
    Delete all resources that match the current query.

delete type:NSR device; hostname: mars
    Delete the resources with attributes: type: NSR device and hostname: mars.

bind type:NSR
    Limit administration to the NSR service and the resources it manages.

SEE ALSO
ed(1), vi(1), curses(3), nsr_resource(5) resource(5).

DIAGNOSTICS

The following exit status values are meaningful:

0   Interactive mode exited normally.

1   Usage or other non-query related error.

2   When reading input from a file (-i file), one or more RAP operations failed. This status is never returned interactively.

Standard Error Messages:
    Individual servers may return additional error messages besides those listed here, or may return more specific forms of these messages including more information.

Operation not supported
    The requested operation is not supported by the current server.

Bad getids arguments
    A lookup-by-ID was attempted, and the requested IDs are not in the correct format.

Bad create arguments
    One or more of the attributes or values specified in the requested resource create operation were invalid. After correcting the mistake(s), the operation may be re-attempted.

Bad delete arguments
    One or more of the attributes or values specified in the requested resource delete operation were invalid. One possibility is that the resource may not be deleted.

Bad update arguments
    One or more of the attributes or values specified in the requested resource update operation were invalid. After correcting the mistake(s), the operation may be re-attempted.

Bad retrieve arguments
    One or more of the attributes or values specified in the requested resource update operation were invalid. After correcting the mistake(s), the operation may be re-attempted.

Bad or missing hostname
    The server specified was not valid, or no hostname was given. Correct the name of the server and retry the operation.

Bad or missing version number
    An internal error occured. A RAP operation was attempted to a server supporting a different version of the protocol. Obtain a new version of the client program and try again.

Bad or missing program number
    An internal error occured. A RAP operation was attempted to a server supporting a different version of the protocol. Obtain a new version of the client program and try again.

Bad or missing attribute name
    An attribute required when creating a new resource was missing. Add the attribute and any needed values to the request, and try again.

No such type
    The server does not support resources of the requested type. Double-check the type requested for typographical errors.

Resource does not exist
    The requested resource does not exist; the operation cannot be completed.

Permission denied
    The user does not have permission to perform the desired operation.

Create permission denied
    The user does not have permission to create the desired resource.

system error
    Some unspecified internal system error occurred. The operation may be retried at a later time, and may succeed. Additional errors may be found in server-specific log files.

sequence number mismatch
    An update operation was attempted, but the sequence numbers had changed. Re-retrieve the resource(s), apply the desired change, and re-attempt the update operation.

Resource already exists
    A create operation was attempted, but the resource with the given key (usually name) already exists.

Resource database failure
    Some internal error occured, such as running out of disk space.

Resource parse error
    The syntax of the query was incorrect, and could not be parsed. Double-check the requested operation for typographical errors and try again.

Illegal values selection
    The value for a choice attribute was not valid. Check the valid values (from the resource type descriptor), pick one of those values, and re-attempt the operation.

Illegal numeric value
    The value for a numeric attribute was not valid. Check the ranges of valid values (from the resource type descriptor), pick a value on that range, and re-attempt the operation.

Too many values
    Too many values were specified for an attribute in the query. This usually means that multiple values were specified for an attribute that only allows single values.

Read-only attribute
    An attempt was made to specify a new value for a read-only attribute. Check the type descriptor for the resource for read-only attributes.

No such attribute in this type
    An attribute name specified does not exist for the given resource type. Check the type descriptor for the resource for valid attribute names.

No type attribute specified
    A query did not specify a type attribute, and querying for all types was not valid. Choose a type, add that to the query, and re-attempt the query.

No such host
    The specified server name does not exist.

No such netgroup
    The specified NIS netgroup name does not exist.

No such attribute
    An attribute name specified does not exist for any resource type. Check the type descriptors for valid attribute names.

Resource database busy
    An operation was attempted that would have modified the resource database, but the resource database was locked. Wait a while and re-attempt the operation.