Annelidous-snapshot
view release on metacpan or search on metacpan
Annelidous/Search/Ubersmith.pm view on Meta::CPAN
#!/usr/bin/perl
#
# Annelidous - the flexibile cloud management framework
# Copyright (C) 2009 Eric Windisch <eric@grokthis.net>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero 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 Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
package Annelidous::Search::Ubersmith;
# Inheritance (shorthand for using @INC/require)
use base ("Annelidous::Search");
use Annelidous::Cluster::GrokThis;
use Data::Dumper;
sub new {
my $class=shift;
my $self={
-dbh=>undef,
@_
};
bless $self, $class;
if (defined $self->{-dbh}) {
$self->{dbh}=$self->{-dbh};
}
return $self;
}
#
# CPU lookup table.
# TODO: lookup_cpu is static, must be made dynamic...
#
sub lookup_cpu {
my $self=shift;
my $plan=shift;
#$self->memhash{$plan};
my $cpuhash={
vi05=>1,
vi06=>1,
vi10=>1,
vi11=>1,
vi20=>1,
vi40=>1,
gvs=>2,
gvm=>2,
gvl=>2,
gvx=>2
};
return $cpuhash->{$plan};
( run in 1.305 second using v1.01-cache-2.11-cpan-302cb4679cc )