Class: StackMate::CloudStackResource

Inherits:
Ruote::Participant
  • Object
show all
Includes:
Logging
Defined in:
lib/stackmate/participants/cloudstack.rb

Direct Known Subclasses

CloudStackInstance, CloudStackSecurityGroup

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Logging

configure_logger_for, #logger, logger_for

Constructor Details

#initialize(opts) ⇒ CloudStackResource

Returns a new instance of CloudStackResource.



20
21
22
23
24
25
26
# File 'lib/stackmate/participants/cloudstack.rb', line 20

def initialize(opts)
    @opts = opts
    @url = opts['URL'] || ENV['URL'] or raise ArgumentError.new("CloudStackResources: no URL supplied for CloudStack API")
    @apikey = opts['APIKEY'] || ENV['APIKEY'] or raise ArgumentError.new("CloudStackResources: no api key supplied for CloudStack API")
    @seckey = opts['SECKEY'] || ENV['SECKEY'] or raise ArgumentError.new("CloudStackResources: no secret key supplied for CloudStack API")
    @client = CloudstackRubyClient::Client.new(@url, @apikey, @seckey, false)
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



18
19
20
# File 'lib/stackmate/participants/cloudstack.rb', line 18

def name
  @name
end

Instance Method Details

#on_workitemObject



28
29
30
31
# File 'lib/stackmate/participants/cloudstack.rb', line 28

def on_workitem
  p workitem.participant_name
  reply
end