Class: StatusCat::Checkers::S3

Inherits:
Base
  • Object
show all
Defined in:
lib/status_cat/checkers/s3.rb

Constant Summary

Constants inherited from Base

Base::FORMAT

Instance Attribute Summary

Attributes inherited from Base

#status, #value

Instance Method Summary collapse

Methods inherited from Base

class_to_name, #name, #to_s

Constructor Details

#initializeS3

Returns a new instance of S3.



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/status_cat/checkers/s3.rb', line 5

def initialize
  if !defined?( ::AWS )
    @status = 'aws-sdk gem not installed'
  else
    @value = AWS.config.access_key_id
    @status = fail_on_exception do
      s3 = AWS::S3.new
      ( s3.buckets.count > 0 ) ? nil : 'no buckets'
    end
  end
end