Class: CPEE::Instances

Inherits:
Riddl::Implementation
  • Object
show all
Defined in:
lib/cpee/implementation.rb

Overview

}}}

Instance Method Summary collapse

Instance Method Details

#responseObject

{{{



110
111
112
113
114
115
116
117
118
119
120
121
# File 'lib/cpee/implementation.rb', line 110

def response
  controller = @a[0]
  Riddl::Parameter::Complex.new("wis","text/xml") do
    ins = XML::Smart::string('<instances/>')
    controller.each do |k,v|
      name = v.properties.data.find("string(/p:properties/p:info)")
      state = v.properties.data.find("string(/p:properties/p:state)")
      ins.root.add('instance',name, 'id' => k, 'state' => state)
    end
    ins.to_s
  end
end