Module: Avm::Instances::Base::AutoValues::Access
- Defined in:
- lib/avm/instances/base/auto_values/access.rb
Instance Method Summary collapse
- #auto_access ⇒ Object
- #auto_ssh_hostname ⇒ Object
- #auto_ssh_port ⇒ Object
- #auto_ssh_url ⇒ Object
- #auto_ssh_url_by_parts ⇒ Object
- #auto_ssh_username ⇒ Object
Instance Method Details
#auto_access ⇒ Object
8 9 10 |
# File 'lib/avm/instances/base/auto_values/access.rb', line 8 def auto_access read_entry_optional('ssh.url').present? ? 'ssh' : 'local' end |
#auto_ssh_hostname ⇒ Object
12 13 14 |
# File 'lib/avm/instances/base/auto_values/access.rb', line 12 def auto_ssh_hostname inherited_entry_value(::Avm::Instances::EntryKeys::HOST_ID, 'ssh.hostname') end |
#auto_ssh_port ⇒ Object
16 17 18 |
# File 'lib/avm/instances/base/auto_values/access.rb', line 16 def auto_ssh_port inherited_entry_value(::Avm::Instances::EntryKeys::HOST_ID, 'ssh.port') || 22 end |
#auto_ssh_url ⇒ Object
24 25 26 27 |
# File 'lib/avm/instances/base/auto_values/access.rb', line 24 def auto_ssh_url inherited_entry_value(::Avm::Instances::EntryKeys::HOST_ID, 'ssh.url') || auto_ssh_url_by_parts end |
#auto_ssh_url_by_parts ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/avm/instances/base/auto_values/access.rb', line 29 def auto_ssh_url_by_parts read_entry_optional('ssh.hostname').if_present do |a| a = read_entry_optional('ssh.username').if_present(a) { |v| "#{v}@#{a}" } a = read_entry_optional('ssh.port').if_present(a) { |v| "#{a}:#{v}" } "ssh://#{a}" end end |