Class: EY::CloudClient::Instance
- Inherits:
-
Object
- Object
- EY::CloudClient::Instance
- Defined in:
- lib/engineyard-cloud-client/models/instance.rb
Instance Method Summary collapse
- #has_app_code? ⇒ Boolean
- #provisioned? ⇒ Boolean
- #remove ⇒ Object
- #running? ⇒ Boolean
- #sort_attributes ⇒ Object
Instance Method Details
#has_app_code? ⇒ Boolean
9 10 11 |
# File 'lib/engineyard-cloud-client/models/instance.rb', line 9 def has_app_code? !["db_master", "db_slave"].include?(role.to_s) end |
#provisioned? ⇒ Boolean
17 18 19 |
# File 'lib/engineyard-cloud-client/models/instance.rb', line 17 def provisioned? hostname && role && status != "starting" # not foolproof, but help throw out bad instances end |
#remove ⇒ Object
21 22 23 |
# File 'lib/engineyard-cloud-client/models/instance.rb', line 21 def remove environment.remove_instance(self) end |
#running? ⇒ Boolean
13 14 15 |
# File 'lib/engineyard-cloud-client/models/instance.rb', line 13 def running? status == "running" end |
#sort_attributes ⇒ Object
25 26 27 28 29 |
# File 'lib/engineyard-cloud-client/models/instance.rb', line 25 def sort_attributes # Shift app_master above app since that's how it's usually shown sort_role = role == 'app' ? 'app_slave' : role [sort_string(sort_role), sort_string(name), sort_string(hostname)] end |