Class: Yao::Resources::Router
Instance Attribute Summary
#service
Class Method Summary
collapse
Instance Method Summary
collapse
included, #project
Methods inherited from Base
#[], #[]=, add_instantiation_name_list, #destroy, friendly_attributes, #id, #initialize, instantiation?, map_attribute_to_attribute, map_attribute_to_resource, map_attribute_to_resources, map_attributes_to_time, #to_hash, #update
#admin=, #api_version, #api_version=, #as_member, #client, #create, #destroy, extended, #find_by_name, #get, #get!, #list, #resources_path, #resources_path=, #return_single_on_querying, #return_single_on_querying=, #update
Class Method Details
.add_interface(id, param) ⇒ Hash
38
39
40
|
# 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) ⇒ Hash
45
46
47
|
# 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
|
Instance Method Details
#enable_snat ⇒ bool
13
14
15
|
# File 'lib/yao/resources/router.rb', line 13
def enable_snat
external_gateway_info["enable_snat"]
end
|
#external_fixed_ips ⇒ Array<Hash>
18
19
20
|
# File 'lib/yao/resources/router.rb', line 18
def external_fixed_ips
external_gateway_info["external_fixed_ips"]
end
|
#external_network ⇒ Yao::Resource::Network
23
24
25
26
27
|
# 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
|
30
31
32
|
# File 'lib/yao/resources/router.rb', line 30
def interfaces
Yao::Port.list(device_id: id)
end
|