nla.py

class nla.nla_cmd(completekey='tab', stdin=None, stdout=None)

nla.py provides a command line interface to the NLA system that can be run from JASMIN.

It provides a number of commands for performing common tasks with the NLA, such as making a request for files to be restored, changing the retention date of requests, checking a users quota, etc.

It is built upon the Python cmd library: cmd Support for line-oriented command interpreters, and so each function takes the command argument (a string) as its input parameter.

static check_request_id(line)

check the first element of a line is a valid request id.

do_EOF(line)

Quit

do_expire(line)

Set a request as expired by setting the retention date to now.

do_label(line)

Add a label to a request. NLA>>> label 23 John's list of files This labels request number 23 "John's list of files".

do_listing_request(line)

Make a tape request from a file listing. The file paths should be one per line and absolute.

do_ls(line)

List files in the NLA system.

Files in the system go through various stages:

  • U: "Unverified" files have been earmarked for tape only archive, but are not yet checked to see if the tape copy is valid.

  • D "On Disk" files have been verified as having a valid tape copy but have not had the original disk copy deleted.

  • T "On Tape" files have been removed from disk and only exist as a tape copy.

  • A "Restoring" files are in the process of Actively being restored to disk.

  • R "Restored" files are on restoreed to disk. A symlink from the original path points to its tempory location.

    After the restore request has expired, the disk copy will be removed and the file will be labelled as "On Tape" again.

Use the -stage option to list only files at certain stages. e.g. to list unverified, on disk and on tape files:

ls -stages=UDT

The rest of the arguments are a simple contains filter. e.g. for all files with 2015/12/04 in the path:

ls 2015/12/04

do_notify(line)

Set the email address to notify for the arrivals of both the first and last file from tape. i.e. combine notify_first and notify_last to have the same email address

do_notify_first(line)

Set the email address to notify on the arrival of the first file from tape.

do_notify_last(line)

Set the email address to notify on the arrival of the last file from tape.

do_pattern_request(line)

Request files by matching the pattern string to a substring in the filename

do_quit(line)

Quit

do_quota(line)

Check amount of quota remaining

do_req(line)

Show details of a request.

do_requested_files(line)

List the files in a request.

do_requests(line)

List requests for current user.

do_retain(line)

Set a retention date for a request.

emptyline()

Called when an empty line is entered in response to the prompt.

If this method is not overridden, it repeats the last nonempty command entered.