Class: Status

Inherits:
Object
  • Object
show all
Extended by:
RightScale::Api::BaseExtend
Includes:
RightScale::Api::Base
Defined in:
lib/rest_connection/rightscale/status.rb

Overview

This is the v4 image only work status api. was used by Server#run_script (depricating..)

API 1.0

Instance Attribute Summary

Attributes included from RightScale::Api::Base

#params

Instance Method Summary collapse

Methods included from RightScale::Api::BaseExtend

[], create, deny_methods, filters, find, find_all, find_by, find_by_cloud_id, find_by_id, find_by_nickname, find_by_nickname_speed, find_with_filter, resource_plural_name, resource_singular_name

Methods included from RightScale::Api::BaseConnection

#connection

Methods included from RightScale::Api::Base

#[], #[]=, #destroy, #initialize, #method_missing, #reload, #resource_plural_name, #resource_singular_name, #rs_id, #save

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RightScale::Api::Base

Instance Method Details

#wait_for_completed(audit_link = "no audit link available", timeout = 900) ⇒ Object



35
36
37
38
39
40
41
42
43
44
45
# File 'lib/rest_connection/rightscale/status.rb', line 35

def wait_for_completed(audit_link = "no audit link available", timeout = 900)
  while(timeout > 0)
    reload
    return true if self.state == "completed"
    raise "FATAL error, script failed\nSee Audit: #{audit_link}" if self.state == 'failed'
    sleep 30
    timeout -= 30
    connection.logger("querying status of right_script.. got: #{self.state}")
  end
  raise "FATAL: Timeout waiting for Executable to complete.  State was #{self.state}" if timeout <= 0
end