Sha256: 11d82edfd17012987ac7142c8738e3173dcd941aa6ec6a2b7b3732fd557c5be1
Contents?: true
Size: 1.17 KB
Versions: 6
Compression:
Stored size: 1.17 KB
Contents
require "fog" module Capistrano module Elobuff module Ec2 class Server def initialize(fog_server, application) @server = fog_server @application = application end def to_s "%-24s%-16s%-48s%-16s%-16s%-16s%-24s%s" % [name, id, address, @server.image_id, @server.availability_zone, @server.state, @server.groups.join(","), roles.join(",")] end def available? @server.state == "running" end def id @server.id end def slug @server.id.gsub(/i-/, "") end def name @server.tags["Name"] end def name=(string) @server.tags["Name"] = string end def address @server.dns_name end def tags @server.tags end def zone @server.availability_zone end def roles @server.tags[@application].split(",").map(&:to_sym) end def roles=(string) @server.tags[@application] = string end def terminate! @server.destroy end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems