FusionInventory::Agent::Storage.3pm

Langue: en

Version: 2010-05-26 (ubuntu - 24/10/10)

Section: 3 (Bibliothèques de fonctions)

NAME

FusionInventory::Agent::Storage - the light data storage API. Data will be stored in a subdirectory in the 'vardir' directory. This subdirectory depends on the caller module name.

SYNOPSIS

   my $storage = new FusionInventory::Agent::Storage({
       target => {
           vardir => $ARGV[0],
       }
   });
   my $data = $storage->restore({
           module => "FusionInventory::Agent"
       });
 
   $data->{foo} = 'bar';
 
   $storage->save({ data => $data });
 
 

DESCRIPTION

This module is a wrapper for restore and save. it called $inventory in general.
new({ config => $config, target => $target })
Create the object
save({ data => $date, idx => $ref })
Save the reference. $idx is an integer. You can use if if you want to save more than one file for the module. This number will be add at the of the file
restore({ module => $module, idx => $idx})
Returns a reference to the stored data. If $idx is defined, it will open this substorage.
remove({ module => $module, idx => $idx })
Returns the files stored on the filesystem for the module $module or for the caller module. If $idx is defined, only the submodule $idx will be removed.
removeAll({ module => $module, idx => $idx })
Deletes the files stored on the filesystem for the module $module or for the caller module.
removeSubDumps({ module => $module })
Deletes the sub files stored on the filesystem for the module $module or for the caller module.