App::MBUtiny::CollectorAgent - Agent for access to App::MBUtiny collector server
Version 1.02
use App::MBUtiny::CollectorAgent; my $agent = new App::MBUtiny::CollectorAgent( uri => "https://mbutiny.example.com/collector.cgi", ); my $status = $agent->check; if ($status) { print STDOUT $agent->response->{data}{message}; } else { print STDERR $agent->error; }
Agent for access to App::MBUtiny collector server
my $agent = new App::MBUtiny::CollectorAgent( uri => $uri, # Collector URI user => $user, # optional password => $password, # optional timeout => $timeout, # default: 180 );
Returns agent
my $status = $agent->check;
Returns check-status of collector. 0 - Error; 1 - Ok
See README file for details of data format
my $status = $agent->del( host => $hostname, file => $filename, );
Request for deleting of file on collector by hostname and filename. The method returns status of operation: 0 - Error; 1 - Ok
my $status = $agent->download( host => $hostname, file => $filename, path => "/file/to/write", );
Request for download file on collector by hostname and filename. Result will be written to "path" file. The method returns status of operation: 0 - Error; 1 - Ok
print $agent->error;
Returns error string
$status = $agent->fixup( type => $type, # 0 - external / 1 - internal (Uploaded earlier) id => $id, # ID of file (type = 1 only) host => $hostname, file => $filename, path => $filepath, # /path/to/filename sha1 => $sha1, # Optional md5 => $md5, # Optional status => $status, # 1 - good backup / 0 - bad backup comment => $comment, # Optional message => "Your files successfully stored ...", # Optional );
Request for fixupping of backup on collector by hostname and others parameters. The method returns status of operation: 0 - Error; 1 - Ok
my $status = $agent->info( host => $hostname, file => $filename, );
Request for getting information about file on collector by hostname and filename. The method returns status of operation: 0 - Error; 1 - Ok
my $status = $agent->list( host => $hostname, );
Request for getting list of files on collector by hostname. The method returns status of operation: 0 - Error; 1 - Ok
my $status = $agent->report( host => $hostname, # Optional. Default: all hosts start => '01.09.2014', # Optional. Default: current date finish => '09.09.2014', # Optional. Default: current date type => 2, # 0 - external; 1 - internal; 2 - both (all, default) );
Request for getting report of backup on collector by hostname. The method returns status of operation: 0 - Error; 1 - Ok
my $request = $agent->request;
Returns request hash
my $response = $agent->response;
Returns response hash
my $status = $agent->status;
Returns object status value. 0 - Error; 1 - Ok
$status = $agent->upload( host => $hostname, file => $filename, path => $filepath, # /path/to/filename sha1 => $sha1, # Optional md5 => $md5, # Optional comment => $comment, # Optional );
Request for uploading of backup on collector by hostname and others parameters. The method returns status of operation: 0 - Error; 1 - Ok
See CHANGES file
CHANGES
See TODO file
TODO
* none noted
App::MBUtiny
Serz Minus (Lepenkov Sergey) http://www.serzik.com <minus@mail333.com>
Copyright (C) 1998-2014 D&D Corporation. All Rights Reserved
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
See LICENSE file
LICENSE
To install App::MBUtiny, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::MBUtiny
CPAN shell
perl -MCPAN -e shell install App::MBUtiny
For more information on module installation, please visit the detailed CPAN module installation guide.