Module: FogExtensions::AWS::Server

Extended by:
ActiveSupport::Concern
Defined in:
app/models/concerns/fog_extensions/aws/server.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#managed_ipObject

Returns the value of attribute managed_ip


6
7
8
# File 'app/models/concerns/fog_extensions/aws/server.rb', line 6

def managed_ip
  @managed_ip
end

Instance Method Details

#dnsObject


16
17
18
# File 'app/models/concerns/fog_extensions/aws/server.rb', line 16

def dns
  dns_name || private_dns_name
end

#ip_addressesObject


36
37
38
# File 'app/models/concerns/fog_extensions/aws/server.rb', line 36

def ip_addresses
  [public_ip_address, private_ip_address].flatten.select(&:present?)
end

#nameObject


12
13
14
# File 'app/models/concerns/fog_extensions/aws/server.rb', line 12

def name
  to_s
end

#poweroffObject


24
25
26
# File 'app/models/concerns/fog_extensions/aws/server.rb', line 24

def poweroff
  stop(true)
end

#resetObject


28
29
30
# File 'app/models/concerns/fog_extensions/aws/server.rb', line 28

def reset
  poweroff && start
end

#to_sObject


8
9
10
# File 'app/models/concerns/fog_extensions/aws/server.rb', line 8

def to_s
  tags.try(:[], 'Name') || identity
end

#vm_descriptionObject


32
33
34
# File 'app/models/concerns/fog_extensions/aws/server.rb', line 32

def vm_description
  flavor.to_label
end

#vm_ip_addressObject


20
21
22
# File 'app/models/concerns/fog_extensions/aws/server.rb', line 20

def vm_ip_address
  (managed_ip == 'private') ? private_ip_address : public_ip_address
end