gd_unmarkfordeletion

Recovers data marked for deletion, if it has not been permanently deleted by an administrator.

 

Syntax 

unmarktotal = gd_unmarkfordeletion(ID)

unmarktotal = gd_unmarkfordeletion(IDs)

 

Description

unmarktotal = gd_unmarkfordeletion(ID) takes an ID string and unmarks the corresponding file, variable or datagroup so it is no longer marked for deletion from the archive. This is a safety measure to recover data that was mistakenly marked for deletion. This function is only applicable for data that has not already been permanently deleted from the archive by an administrator. The function returns 1 if successful or 0 if failed, in which case the reason is displayed in a warning message (for example the ID does not exist). If data is successfully unmarked it is visible again to gd_query, gd_retrieve and other Database Toolbox functions.

 

unmarktotal = gd_unmarkfordeletion(IDs) is similar but takes a list of ID strings and unmarks the corresponding files, variables and datagroups so they are no longer marked for deletion from the archive. The function returns unmarktotal, the total number of IDs successfully unmarked for deletion, and displays warning messages for those that were unsuccessful.

 

Examples

Unmark a single file so that it is no longer eligible for deletion from the archive.

 

from gddatabase import *

ID = gd_archive('C:/file.dat')

gd_markfordeletion(ID)

unmarktotal = gd_unmarkfordeletion(ID)

print unmarktotal

 

1

 

Query variable metadata that has been marked for deletion, and then unmark the corresponding variables so that they are no longer eligible for deletion from the archive.

 

q = 'standard.archiveDate > 2004-12-01 & a.b < -500'

qresults = gd_querydeleted(q,'varmeta')

IDs = []

for i in range(len(qresults)):

    IDs.append(qresults[i]['standard']['ID'])

 

unmarktotal = gd_unmarkfordeletion(IDs)

print unmarktotal

 

5

 

Notes

Only the owner of the data (the person who archived it) can unmark it for deletion.

 

If the marked data has been permanently deleted from the archive by an administrator it cannot be recovered.

 

A valid proxy certificate is required (see gd_createproxy from the Geodise Compute Toolbox).

 

See also

gd_markfordeletion, gd_querydeleted, gd_createproxy




gd_retrieve

contents

xmltoolbox

Copyright © 2005, The Geodise Project, University of Southampton