class Yao::Resources::Router
Public Class Methods
add_interface(id, param)
click to toggle source
@param id [String] @param param [Hash] @return [Hash]
# File lib/yao/resources/router.rb, line 38 def add_interface(id, param) PUT(['routers', id, 'add_router_interface.json'].join('/'), param.to_json) end
remove_interface(id, param)
click to toggle source
@param id [String] @param param [Hash] @return [Hash]
# File lib/yao/resources/router.rb, line 45 def remove_interface(id, param) PUT(['routers', id, 'remove_router_interface.json'].join('/'), param.to_json) end
Public Instance Methods
enable_snat()
click to toggle source
@return [bool]
# File lib/yao/resources/router.rb, line 13 def enable_snat external_gateway_info["enable_snat"] end
external_fixed_ips()
click to toggle source
@return [Array<Hash>]
# File lib/yao/resources/router.rb, line 18 def external_fixed_ips external_gateway_info["external_fixed_ips"] end
external_network()
click to toggle source
@return [Yao::Resource::Network]
# File lib/yao/resources/router.rb, line 23 def external_network @external_network ||= if network_id = external_gateway_info["network_id"] Yao::Network.get(network_id) end end
interfaces()
click to toggle source
@return [Array<Yao::Resources::Port>]
# File lib/yao/resources/router.rb, line 30 def interfaces Yao::Port.list(device_id: id) end