Class: VCloudSdk::EdgeGateway
- Inherits:
-
Object
- Object
- VCloudSdk::EdgeGateway
- Extended by:
- Forwardable
- Includes:
- Infrastructure
- Defined in:
- lib/ruby_vcloud_sdk/edge_gateway.rb
Constant Summary
Constants included from Infrastructure
Infrastructure::ERROR_STATUSES, Infrastructure::SUCCESS_STATUS
Instance Method Summary collapse
-
#initialize(session, link) ⇒ EdgeGateway
constructor
A new instance of EdgeGateway.
- #public_ip_ranges ⇒ Object
Constructor Details
#initialize(session, link) ⇒ EdgeGateway
Returns a new instance of EdgeGateway.
12 13 14 15 |
# File 'lib/ruby_vcloud_sdk/edge_gateway.rb', line 12 def initialize(session, link) @session = session @link = link end |
Instance Method Details
#public_ip_ranges ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/ruby_vcloud_sdk/edge_gateway.rb', line 17 def public_ip_ranges uplink_gateway_interface = entity_xml .gateway_interfaces .find { |g| g.interface_type == "uplink" } ip_ranges = uplink_gateway_interface.ip_ranges return IpRanges.new unless ip_ranges ip_ranges .ranges .reduce(IpRanges.new) do |result, i| result + IpRanges.new("#{i.start_address}-#{i.end_address}") end end |