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
# File 'lib/status_cat/checkers/s3.rb', line 5

def initialize
  return if gem_missing?('aws-sdk-s3', defined?(::Aws))

  @value = Aws.config[:credentials].access_key_id
  @status = fail_on_exception { test }
end

Instance Method Details

#testObject



12
13
14
15
# File 'lib/status_cat/checkers/s3.rb', line 12

def test
  s3 = Aws::S3::Resource.new
  return s3.buckets.count.zero? ? 'no buckets' : nil
end