This file is indexed.

/usr/share/perl5/VM/EC2/DB/Reserved/Instance/Offering.pm is in libvm-ec2-perl 1.28-2build1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
package VM::EC2::DB::Reserved::Instance::Offering;

=head1 NAME

VM::EC2::DB::Reserved::Instance::Offering - An RDS Database Reserved Instance Offering

=head1 SYNOPSIS

 use VM::EC2;

 $ec2 = VM::EC2->new(...);
 my @i = $ec2->describe_reserved_db_instances_offerings;
 print "$_\n" foreach grep { $_->MultiAZ } @i;

=head1 DESCRIPTION

This object represents an RDS Reserved Instance Offering.  It is returned by
the VM::EC2->describe_reserved_db_instances_offerings() call.

=head1 STRING OVERLOADING

In string context, this object returns a formatted string containing all the data
available on the reserved instance offering.

=head1 SEE ALSO

L<VM::EC2>
L<VM::EC2::Generic>
L<VM::EC2::DB::Instance>

=head1 AUTHOR

Lance Kinley E<lt>lkinley@loyaltymethods.comE<gt>.

Copyright (c) 2013 Loyalty Methods, Inc.

This package and its accompanying libraries is free software; you can
redistribute it and/or modify it under the terms of the GPL (either
version 1, or at your option, any later version) or the Artistic
License 2.0.  Refer to LICENSE for the full license text. In addition,
please see DISCLAIMER.txt for disclaimers of warranty.

=cut

use strict;
use base 'VM::EC2::Generic';
use VM::EC2::DB::Reserved::RecurringCharge;

use overload '""' => sub { shift->as_string },
    fallback => 1;

sub valid_fields {
    my $self = shift;
    return qw(
        CurrencyCode
        DBInstanceClass
        Duration
        FixedPrice
        MultiAZ
        OfferingType
        ProductDescription
        RecurringCharges
        ReservedDBInstancesOfferingId
        UsagePrice
    );
}

sub MultiAZ {
    my $self = shift;
    my $maz = $self->SUPER::MultiAZ;
    return $maz eq 'true';
}

sub RecurringCharges {
    my $self = shift;
    my $rc = $self->SUPER::RecurringCharges;
    return unless $rc;
    $rc = $rc->{RecurringCharge};
    return ref $rc eq 'HASH' ?
       (VM::EC2::DB::Reserved::RecurringCharge->new($rc,$self->aws)) :
       map { VM::EC2::DB::Reserved::RecurringCharge->new($_,$self->aws) } @$rc;
}

sub as_string {
    my $self = shift;
    my $delim = shift || '  ';
    my @fields;
    push @fields, $self->ReservedDBInstancesOfferingId;
    push @fields, sprintf('%18s',$self->OfferingType);
    push @fields, sprintf('%4i Days',$self->Duration / 86400);
    push @fields, sprintf('%13s',$self->DBInstanceClass);
    push @fields, sprintf('%9s',$self->MultiAZ ? 'Multi AZ' : 'Single AZ');
    push @fields, sprintf('%s%8s',$self->CurrencyCode,sprintf('%.2f',$self->FixedPrice));
    push @fields, sprintf('%s%6s/Hourly',$self->CurrencyCode,sprintf('%.3f',$self->UsagePrice));
    push @fields, $self->RecurringCharges ? sprintf('%s%6s/' . $self->RecurringCharges->frequency,$self->CurrencyCode,sprintf('%.3f',$self->RecurringCharges->amount)) : ' ' x 16;
    push @fields, $self->ProductDescription;
    return join($delim,@fields)
}

1;