TapeFile¶
-
class
nla_control.models.
TapeFile
(*args, **kwargs)¶ Files that are archived on tape as the primary media, and have been added to the NLA system via move_files_to_nla.
- Variables
logical_path (models.CharField) -- The original logical of the file in the archive, before it was moved to tape
size (FileSizeField) -- The size of the file (in bytes)
verified (models.DateTimeField) -- The time and date that the file was verified within the NLA system
stage (models.IntegerField) --
The stage that the file is at, one of UDTAR
U: UNVERIFIED (3)
D: ONDISK (2)
T: ONTAPE (0)
A: RESTORING (1)
R: RESTORED (5)
restore_disk (models.ForeignKey) -- A reference to the RestoreDisk where the file has been restored to
-
exception
DoesNotExist
¶
-
exception
MultipleObjectsReturned
¶
-
static
add
(file_path, size)¶ Method to add a logical path as a TapeFile if its not already present on the NLA system.
- Parameters
file_path (string) -- The (original) logical path to the file, before it was archived to tape
size (integer) -- The size of the file, in bytes
-
archive_volume_path
()¶ Return the current volume path for a file. e.g. /datacentre/archvol/pan52/archive
- Returns
volume path of the TapeFile
- Return type
string
-
static
load_storage_paths
()¶ Load the fileset logical paths to spotname mappings by retrieving the spotnames from a URL, finding the corresponding logical path for the spot and reformatiing them into a dictionary
-
match
(pattern)¶ Return whether the logical path of this TapeFile matches the input pattern (a UNIX filesystem pattern).
- Parameters
pattern (string) -- The UNIX filesystem pattern to match against
- Returns
True | False
- Return type
boolean
-
spotname
()¶ Return portion of path that maps to spot name, and the spotname for a file. e.g.
/badc/cira/data/x.dat -> /badc/cira, spot-1234-cira
This function is used to give the elements needed to construct a storage path.
- Returns
A tuple of (logical_spot_path, spot_name)
- Return type
(string, string)
-
storage_path
()¶ Return the current storage path to file.
- Returns
storage path of the TapeFile
- Return type
string