OpenFAM Reference Implementation

openfam::fam::fam_delete_backup

delete backup data from archival storage.

Synopsis

void *fam_delete_backup(const char *BackupName);

Description

Initiates a deletion of given backup from archival storage.

Input Arguments

Name Description
BackupName Name of the backup.

Return Values

Returns a pointer to the wait object for the delete_backup operation. This object can be used to wait for the completion of the delete_backup operation. Throws Fam_Exception on error.

Fam Error Numbers

ErrorDescription
FAM_ERR_INVALIDAPI called with incorrect parameters.
FAM_ERR_NOPERMCaller does not have access rights
FAM_ERR_OUTOFRANGEData access out of range.
FAM_ERR_LIBFABRICLibfabric error occurred.
FAM_ERR_RPCCommunication error from grpc layer.
FAM_ERR_RPC_CLIENT_NOTFOUNDRPC service not available.
FAM_ERR_METADATAMetadata service error.
FAM_ERR_MEMORYMemory service error.
FAM_ERR_RESOURCEResource not available.
FAM_BACKUP_NOTFOUNDBackup not available.

Notes

Note that the method is non-blocking: it returns after the backup deletion has been initiated, and does not wait for completion of deletion operation.

Example

#include <string.h>
#include <fam/fam.h>
#include <fam/fam_exception.h>
using namespace std;
using namespace openfam;
	
int main(void) {
	fam *myFam = new fam();
	
	// ... Initialization code here

	 try {
		
		// name of backup for given data item.
		char *backupName = (char *)malloc(FILE_MAX_LEN);
		sprintf(backupName, "%s.%s", "myRegion", "myItem");
		
		// delete given backupName from archival storage and returns a waitObject to delete operation.
		void *waitObj = myFam->fam_delete_backup(backupName);
	
		// Wait for delete operation to complete.
		myFam->fam_delete_backup_wait(waitObj);
		printf("deletion of backup is successful\n");
	 } catch (Fam_Exception &e) {
		printf("fam API failed: %d: %s\n", e.fam_error(), e.fam_error_msg());
	 }
	
	 // ... subsequent code here
}