Class: Kato::InstanceStatus

Inherits:
Object
  • Object
show all
Defined in:
lib/kato/pool_manager.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(instance_id, state, last_interval, timestamp) ⇒ InstanceStatus

Returns a new instance of InstanceStatus.



240
241
242
# File 'lib/kato/pool_manager.rb', line 240

def initialize(instance_id, state, last_interval, timestamp)
  @instance_id, @state, @last_interval, @timestamp = instance_id, state, last_interval, timestamp
end

Instance Attribute Details

#instance_idObject

Returns the value of attribute instance_id.



238
239
240
# File 'lib/kato/pool_manager.rb', line 238

def instance_id
  @instance_id
end

#last_intervalObject

Returns the value of attribute last_interval.



238
239
240
# File 'lib/kato/pool_manager.rb', line 238

def last_interval
  @last_interval
end

#stateObject

Returns the value of attribute state.



238
239
240
# File 'lib/kato/pool_manager.rb', line 238

def state
  @state
end

#timestampObject

Returns the value of attribute timestamp.



238
239
240
# File 'lib/kato/pool_manager.rb', line 238

def timestamp
  @timestamp
end

Class Method Details

.parse(xml_or_yaml) ⇒ Object



244
245
246
247
248
249
250
251
# File 'lib/kato/pool_manager.rb', line 244

def self.parse(xml_or_yaml)
  if xml_or_yaml =~ /<InstanceStatus>/
    # FIXME Parse the xml
  else
    status = YAML.load(xml_or_yaml)
    new(status[:instance_id], status[:state], status[:last_interval], status[:timestamp])
  end
end