Class: Pangea::Kubernetes::Types::VpnLinkConfig

Inherits:
Resources::BaseAttributes
  • Object
show all
Defined in:
lib/pangea/kubernetes/types/vpn_config.rb

Overview

A single WireGuard VPN link.

Instance Method Summary collapse

Instance Method Details

#to_hObject



63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/pangea/kubernetes/types/vpn_config.rb', line 63

def to_h
  hash = { name: name }
  hash[:private_key_file] = private_key_file if private_key_file
  hash[:listen_port] = listen_port if listen_port
  hash[:address] = address if address
  hash[:profile] = profile if profile
  hash[:persistent_keepalive] = persistent_keepalive if persistent_keepalive
  hash[:mtu] = mtu if mtu
  hash[:peers] = peers.map(&:to_h) if peers.any?
  hash[:firewall] = firewall.to_h if firewall
  hash
end