Class: CPEE::ModelManagement::AbandonUrl

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

Overview

}}}

Instance Method Summary collapse

Instance Method Details

#responseObject

{{{



541
542
543
544
545
546
547
548
549
550
# File 'lib/cpee-model-management/implementation.rb', line 541

def response
  aba = @p.first.value
  res1 = Typhoeus.get(File.join(aba,'properties','state','/'))
  if res1.success?
    if res1.response_body == 'ready' || res1.response_body == 'stopped'
      Typhoeus.put(File.join(aba,'properties','state','/'), headers: {'Content-Type' => 'application/x-www-form-urlencoded'}, body: "value=abandoned")
    end
  end
  nil
end