class CPEE::Instances

Public Instance Methods

response() click to toggle source
# File lib/cpee/implementation.rb, line 179
def response
  opts = @a[0]
  Riddl::Parameter::Complex.new("wis","text/xml") do
    ins = XML::Smart::string('<instances/>')
    CPEE::Persistence::each_object(opts) do |instance|
      info = CPEE::Persistence::extract_item(instance,opts,'attributes/info')
      uuid = CPEE::Persistence::extract_item(instance,opts,'attributes/uuid')
      state = CPEE::Persistence::extract_item(instance,opts,'state')
      state_changed = CPEE::Persistence::extract_item(instance,opts,'state/@changed')
      ins.root.add('instance', info,  'uuid' => uuid, 'id' => instance, 'state' => state, 'state_changed' => state_changed )
    end
    ins.to_s
  end
end