fcsArchiver.fcsArchiver

class fcsArchiver.fcsArchiver[source]

Our primary archive object

addToArchiveQueue(archiveObject)[source]

Adds the specified archiveObject to the archive queue. We retrieve FCS data via fcsxml.FCSVRClient calls. For XML based workflows, utilize addFileFromXMLPath

addToRestoreQueue(restoreObject)[source]

Adds the specified restoreObject to the restore queue.

archiveFilesFromQueue()[source]

Submit loaded objects in our Queue for archive

archiveSetsWithStatus(status)[source]

Method which returns a dictionary, keyed by the selection set name, which match the provided status, if a set contains multiple objects with different status, we will return a set only with objects matching the provided status

barcodeForArchiveObject(archiveObject, tapeSet='')[source]

Returns the barcode corresponding to the tape the file for the provided archiveObject

barcodeListForActiveRestoreJobs()[source]

Returns a list of barcode numbers in use by active jobs (submitted and running)

changeStatusForArchiveSet(status, archiveSet='')[source]

Changes the status for all archive objects loaded in the provided, can be provided a string name for the set, or the archiveSet object itself

commitArchiveObject(archiveObject)[source]

Commits the passed archiveObject to our archiveQueue

commitArchiveObjectToArchiveHistory(archiveObject)[source]

Commits an archive object to our archiveHistory SQL table

commitArchiveObjectToFCS(archiveObject)[source]

Reports archive object to FCS

commitArchiveObjectsInArchiveSet(archiveSet)[source]

Commits each archiveObject in the provided archiveSet both to the SQL DB as well as FCS

connectToSQL()[source]

Open a connection to sqlite db and save the connection at self.sqlConn

createArchiveObjectFromFilePath(filePath)[source]

Returns an archiveObject loaded from provided filepath. We utilize fcsvr_client to fetch FCS data

createArchiveQueueFromFile(queueFile='')[source]

Reads file from path queueFile, which should be a line delimited list of file paths. We check the filePath against loaded values in our SQL archiveQueue table, merging where appropriate. We also check against our archiveHistory table to ensure that the asset hasn’t already been archived.

createDictFromSQLRow(row, table='archiveQueue')[source]

This function creates an associative dictionary from an SQL results row, necessary for Python versions previous to 2.6 that do not support sqlite3.Row.keys(). Accepts optional parameter table, which is used to specify the table that we are creating the result set for.

createRestoreObjectFromFilePath(filePath)[source]

Returns an archiveObject loaded from provided filepath. We utilize fcsvr_client to fetch FCS data

createRestoreQueueFromFile(queueFile='')[source]

Reads file from path queueFile, which should be a line delimited list of file paths. We check the filePath against loaded values in our SQL restoreQueue table, merging where appropriate.

loadArchiveQueue()[source]

Function which reads our sqlite database and generates archiveSet objects for queued files

loadConfiguration(parser='', filePath='')[source]

Load from configuration file, expects a ConfigParser type object. If you subclass, you should call this function.

loadRestoreQueue()[source]

Function which reads our sqlite database and generates archiveSet objects for queued files

nsdchatBarcodeForVolumeLabel(label)[source]

Returns the volume barcode for provided PresStore tape label

nsdchatCMD()[source]

Returns nsdchat command, this may be wrapped with sudo or ssh, so you should not quote the nsdchat path argument when submitting

nsdchatError()[source]

Returns the last error message reported by nsdchat

nsdchatIsVolumeOnline(label)[source]

Returns the status for volume with provided label, returns True if the asset is on a tape in the library, false if it is not

nsdchatStatusForJobID(jobID)[source]

Uses nsdchat to query the status of job with provided running jobID

nsdchatSubmitArchiveJobForArchiveSet(archiveSet, tapeSet='')[source]

Creates a new selection set and submits the job, returns jobID

nsdchatSubmitRestoreJobForRestoreSet(restoreSet, tapeSet='')[source]

Creates a new selection set and submits the job, returns jobID

nsdchatVolumeBarcodesForFilePathFromArchiveDatabase(filePath, archiveDatabase='Default-Archive')[source]

Returns an array of volume barcodes for the specified path as indexed in the provided archive database

nsdchatVolumeLabelForFilePath(filePath, tapeSet='onsite')[source]

Returns the volume label for file archived at path filePath. If PresStore returns multiple volume labels, only the first volume is returned.

nsdchatVolumeLabelsForFilePathFromArchiveDatabase(filePath, archiveDatabase='Default-Archive')[source]

Returns an array of volume labels for the specified path as indexed in the provided archive database

performArchiveStatusCheck()[source]

Depricated: use processArchiveQueue()

performRestoreStatusCheck()[source]

Depricated: use processArchiveQueue()

predictVolumeBarcodeForLabel(label='')[source]

This function predicts the volume barcode for a label which does not have one associated with it.

processArchiveQueue()[source]

Method which checks on the status of submitted archive jobs. Jobs with a status of ‘archiveSubmitted’ or ‘archiveRunning’ are checked with nsdchat, jobs with a status of ‘archiveFailed’,’archiveDied’, or ‘archiveCancelled’ are resubmitted.

processRestoreQueue()[source]

Method which checks on the status of submitted archive jobs. Jobs with a status of ‘archiveSubmitted’ or ‘archiveRunning’ are checked with nsdchat, jobs with a status of ‘archiveFailed’,’archiveDied’, or ‘archiveCancelled’ are resubmitted.

removeArchiveObjectFromArchiveQueue(archiveObject)[source]

Removes an archive object from the archiveQueue SQL table

removeArchiveObjectFromRestoreQueue(restoreObject)[source]

Removes an archive object from the archiveQueue SQL table

restoreFilesFromQueue()[source]

Submit loaded objects in our Queue for restore

restoreSetsWithStatus(status)[source]

Method which returns a dictionary, keyed by the selection set name, which match the provided status

sendEmail(recipient='', subject='', body='', cc='')[source]

Sends an email with the provided subject and body to the provided recipients. If no recipient is provided, we will load from our config. All server settings are loaded from config.

setJobIDForArchiveSet(jobID, archiveSet='')[source]

Changes the jobID for all archive objects in the SQL queue, can be provided a string name for the set, or the archiveSet object itself

setStatusForRestoreSet(status, restoreSet='')[source]

Changes the status for all archive objects loaded in this restore set

verifyOnlineAssetForArchiveObject(archiveObject, checksum='')[source]

Verifies whether an archiveObject’s asset is online, either in an archived state or in it’s original location.

volumeIsOnlineForRestoreObject(restoreObject, tapeSet='')[source]

Returns true or false based on whether the tape for the provided restoreObject is online. If no tapeSet is specified, we will return true whether an offsite or onsite disk is available, and we will update the tapeSet on the restoreObject accordingly

volumeLabelForArchiveObject(archiveObject, tapeSet='')[source]

Returns the barcode corresponding to the tape the file for the provided archiveObject.

Previous topic

fcsArchiver

Next topic

fcsArchiver.archiveObject

This Page