Amanda::Storage -- interface to storage scripts
use Amanda::Storage;
# load defaulf storage and changer
my $storage = Amanda::Storage->new(catalog => $catalog);
# load specific storage and changer
my $storage = Amanda::Storage->new(storage_name => $storage,
changer_name => $changer,
catalog => $catalog);
my $chg = $storage->{'chg'};
$storage->quit();
All operations in the module return immediately, and take as an argument a callback function which will indicate completion of the changer operation -- a kind of continuation. The caller should run a main loop (see Amanda::MainLoop) to allow the interactions with the changer script to continue.
A new object is created with the new
function as follows:
my $storage = Amanda::Storage->new(storage_name => $storage_name,
changer_name => $changer_name,
catalog => $catalog,
labelstr => $labelstr,
autolabel => $autolabel,
meta_autolabel => $meta_autolabel);
to create a named storage (a name provided by the user, either specifying a storage directly or specifying a storage definition).
If there is a problem creating the new object, then the result is a Amanda::Changer::Error.
Thus the usual recipe for creating a new storage is
my $storage = Amanda::Storage->new(catalog => $catalog);
if ($storage->isa("Amanda::Changer::Error")) {
die("Error creating storage: $sorage");
}
my $chg = $storage->{'chg'};
if ($chg->isa("Amanda::Changer::Error")) {
die("Error creating changer: $chg");
}
catalog
must be an Amanda::DB::Catalog2 object. It is required if you want to use $chg->volume_is_labelable(), $chg->make_new_tape_label(), $chg->make_new_meta_label(), $res->make_new_tape_label() or $res->make_new_meta_label(). labelstr
must be like getconf($CNF_LABELSTR), that value is used if labelstr
is not set. autolabel
must be like getconf($CNF_AUTOLABEL), that value is used if autolabel
is not set. meta_autolabel
must be like getconf($CNF_META_AUTOLABEL), that value is used if meta_autolabel
is not set. =head2 MEMBER VARIABLES
Note that these variables are not set until after the subclass constructor is finished.
$storage>{'storage_name'}
Gives the name of the storage. This name will make sense to the user. It should be used to describe the storage in messages to the user.
This page was automatically generated Tue Mar 19 07:08:17 2019 from the Amanda source tree, and documents the most recent development version of Amanda. For documentation specific to the version of Amanda on your system, use the 'perldoc' command.
Hey! The above document had some coding errors, which are explained below:
You forgot a '=back' before '=head1'