Class: CPEE::Instances

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

Overview

}}}

Instance Method Summary collapse

Instance Method Details

#responseObject

{{{



124
125
126
127
128
129
130
131
132
133
134
135
# File 'lib/cpee/implementation.rb', line 124

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:attributes/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