Class: Bcome::Node::Instance

Inherits:
Base show all
Includes:
InstanceCommand, InstanceSsh
Defined in:
lib/nodes/instance.rb

Instance Attribute Summary

Attributes inherited from Base

#meta_data

Instance Method Summary collapse

Methods included from InstanceSsh

#bastion_ip_address, #direct_ssh_command, #do_ssh, #execute_task, #is_direct_ssh?, #is_jump_ssh?, #is_ssh_jump_host?, #keys, #nat_user, #non_bootstrapped_ssh_command, #ssh, #ssh_jump_command_to_bastion, #ssh_jump_command_to_internal_node, #ssh_key_path, #ssh_user

Methods included from InstanceCommand

#direct_rsync, #direct_rsync_bootstrap, #execute_command, #get, #jump_host_rsync, #jump_host_rsync_bootstrap, #put, #rsync_is_sudo, #run

Methods inherited from Base

#initialize, #method_missing, #set_parent_reference

Methods included from CommandHelper

#run_local

Constructor Details

This class inherits a constructor from Bcome::Node::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Bcome::Node::Base

Instance Method Details

#bootstrap_settingsObject



19
20
21
# File 'lib/nodes/instance.rb', line 19

def bootstrap_settings
  @environment.bootstrap_settings
end

#ec2_hostnameObject



35
36
37
# File 'lib/nodes/instance.rb', line 35

def ec2_hostname
  return "#{hostname_map}.ec2.internal"
end

#hostname_mapObject



31
32
33
# File 'lib/nodes/instance.rb', line 31

def hostname_map
  return "ip-#{ip_address.to_s.gsub(".","-")}"
end

#identifierObject



11
12
13
# File 'lib/nodes/instance.rb', line 11

def identifier
  @identifier
end

#ip_addressObject



15
16
17
# File 'lib/nodes/instance.rb', line 15

def ip_address
  @environment.ssh_mode_type == ::SSH_DIRECT_MODE_IDENTIFIER ? public_ip_address : @external_network_interface_address
end

#local_download_pathObject



47
48
49
# File 'lib/nodes/instance.rb', line 47

def local_download_path
  "#{Dir.pwd}#{@environment.namespace}/#{identifier}"
end

#machinesObject



7
8
9
# File 'lib/nodes/instance.rb', line 7

def machines
  [self]  # for completion
end

#namespaceObject



43
44
45
# File 'lib/nodes/instance.rb', line 43

def namespace
  "#{environment.namespace}/#{identifier}"
end

#proxy(bootstrap = false) ⇒ Object



23
24
25
# File 'lib/nodes/instance.rb', line 23

def proxy(bootstrap = false)
  @environment.proxy(bootstrap)
end

#public_ip_addressObject



27
28
29
# File 'lib/nodes/instance.rb', line 27

def public_ip_address
  @public_ip_address
end

#roleObject



39
40
41
# File 'lib/nodes/instance.rb', line 39

def role
  @role
end