Sha256: 7e4be3ce9c63e3100e82ff0180d00ca1733b35dce8d82522f386f6b8c9399f19

Contents?: true

Size: 562 Bytes

Versions: 3

Compression:

Stored size: 562 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)
      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
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
engineyard-cloud-client-1.0.10 lib/engineyard-cloud-client/models/instance.rb
engineyard-cloud-client-1.0.9 lib/engineyard-cloud-client/models/instance.rb
engineyard-cloud-client-1.0.8 lib/engineyard-cloud-client/models/instance.rb