Class: CPEE::DeleteInstance
- Inherits:
-
Riddl::Implementation
- Object
- Riddl::Implementation
- CPEE::DeleteInstance
- Defined in:
- lib/cpee/implementation.rb
Overview
}}}
Instance Method Summary collapse
-
#response ⇒ Object
{{{.
Instance Method Details
#response ⇒ Object
{{{
341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 |
# File 'lib/cpee/implementation.rb', line 341 def response opts = @a[0] redis = opts[:redis] id = @r[0].to_i unless CPEE::Persistence::exists?(id,opts) @status = 404 return end content = { :state => 'purged', :attributes => CPEE::Persistence::extract_list(id,opts,'attributes').to_h } state = CPEE::Persistence::extract_item(id,opts,'state') if state == 'stopped' || state == 'ready' CPEE::Message::send(:event,'state/change',File.join(opts[:url],'/'),id,content[:attributes]['uuid'],content[:attributes]['info'],content,redis) end empt = CPEE::Persistence::keys(id,opts).to_a empt.delete_if{|e| e =~ /\/handlers/ } redis.multi do |multi| multi.del empt multi.zrem 'instances', id end end |