Class: Slugforge::FogHost

Inherits:
Host
  • Object
show all
Defined in:
lib/slugforge/models/host/fog_host.rb

Instance Attribute Summary

Attributes inherited from Host

#pattern, #server, #slug_name, #status

Instance Method Summary collapse

Methods inherited from Host

#add_action, #complete?, #deploy, #effective_action, #elapsed_time, #failed?, #has_action?, #initialize, #install?, #output, #record_event, #remove_action, #stage?, #success?, #terminated?, #timeline

Constructor Details

This class inherits a constructor from Slugforge::Host

Instance Method Details

#idObject



17
18
19
# File 'lib/slugforge/models/host/fog_host.rb', line 17

def id
  @server.id
end

#ipObject



9
10
11
# File 'lib/slugforge/models/host/fog_host.rb', line 9

def ip
  @server.public_ip_address
end

#is_autoscaled?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/slugforge/models/host/fog_host.rb', line 21

def is_autoscaled?
  !@server.tags["aws:autoscaling:groupName"].nil?
end

#nameObject



5
6
7
# File 'lib/slugforge/models/host/fog_host.rb', line 5

def name
  "instance:#{@server.id}, private_name:#{@server.private_dns_name}, public_name:#{@server.dns_name}, ip:#{@server.public_ip_address}"
end

#ssh_hostObject



13
14
15
# File 'lib/slugforge/models/host/fog_host.rb', line 13

def ssh_host
  @server.dns_name
end

#to_statusObject



25
26
27
28
29
30
31
# File 'lib/slugforge/models/host/fog_host.rb', line 25

def to_status
  super.merge({
    :instance_id => @server.id,
    :private_name => @server.private_dns_name,
    :public_name => @server.dns_name,
  })
end