Sha256: 9e319dc8e9acbb01cba397fabfeb4ad720452e1c26f3f01eafe6e6c99843455d
Contents?: true
Size: 893 Bytes
Versions: 7
Compression:
Stored size: 893 Bytes
Contents
require 'engineyard-cloud-client/models/api_struct' module EY class CloudClient class Instance < ApiStruct.new(:id, :role, :name, :status, :amazon_id, :public_hostname, :environment, :bridge, :availability_zone) alias hostname public_hostname alias bridge? bridge def has_app_code? !["db_master", "db_slave"].include?(role.to_s) end def running? status == "running" end def provisioned? hostname && role && status != "starting" # not foolproof, but help throw out bad instances end def remove environment.remove_instance(self) end 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 end end end
Version data entries
7 entries across 7 versions & 1 rubygems