Class: CloudSpec::AMZN::Instances

Inherits:
Base
  • Object
show all
Defined in:
lib/cloudspec/amzn/instances.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#compute_client, #harvest, #initialize, #load_rules, #mock?, #process_account, #regions

Constructor Details

This class inherits a constructor from CloudSpec::AMZN::Base

Class Method Details

.include_rulesObject



4
5
6
7
# File 'lib/cloudspec/amzn/instances.rb', line 4

def self.include_rules
  CloudSpec.log.debug 'including rules ...'
  include ::AMZN::InstanceRules
end

Instance Method Details

#evaluate_object(account_name, region, object) ⇒ Object



15
16
17
18
19
20
21
22
# File 'lib/cloudspec/amzn/instances.rb', line 15

def evaluate_object(, region, object)
  CloudSpec.log.debug "Evaluating object #{object.id} ..."
  begin
    evaluate(object)
  rescue RSpec::Expectations::ExpectationNotMetError => e
    CloudSpec.log.error "[#{}][#{region}][#{object.id}] - " + e.to_s
  end
end

#objects(credentials, region) ⇒ Object



9
10
11
12
13
# File 'lib/cloudspec/amzn/instances.rb', line 9

def objects(credentials, region)
  CloudSpec.log.debug 'getting instances ...'
  aws_client = compute_client(credentials, region)
  aws_client.servers
end