Sha256: 27447d016e621a64500ff4294403396e6965cb2411fe5c3ba9efea235e7ef9de

Contents?: true

Size: 1.1 KB

Versions: 14

Compression:

Stored size: 1.1 KB

Contents

module Vcloud
  module Core
    class EdgeGatewayInterface

      attr_accessor :name, :network_href, :network_name

      # Return a new instance of an EdgeGatewayInterface
      #
      # @param gateway_interface_hash [Hash] The configuration of EdgeGatewayInterface
      # @return [Vcloud::Core::EdgeGatewayInterface]
      def initialize(gateway_interface_hash)
        if gateway_interface_hash.nil?
          raise "EdgeGatewayInterface: gateway_interface_hash cannot be nil"
        end
        unless gateway_interface_hash[:Name] && gateway_interface_hash[:Network]
          raise "EdgeGatewayInterface: bad input: #{gateway_interface_hash}"
        end
        @vcloud_gateway_interface = gateway_interface_hash
        @name = gateway_interface_hash[:Name]
        @network_href = gateway_interface_hash[:Network][:href]
        @network_name = gateway_interface_hash[:Network][:name]
      end

      # Get the ID of EdgeGatewayInterface from the @network_href
      #
      # @return [String] The ID of EdgeGatewayInterface
      def network_id
        network_href.split('/').last
      end

    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
vcloud-core-2.2.0 lib/vcloud/core/edge_gateway_interface.rb
vcloud-core-2.1.1 lib/vcloud/core/edge_gateway_interface.rb
vcloud-core-2.1.0 lib/vcloud/core/edge_gateway_interface.rb
vcloud-core-2.0.1 lib/vcloud/core/edge_gateway_interface.rb
vcloud-core-2.0.0 lib/vcloud/core/edge_gateway_interface.rb
vcloud-core-1.2.0 lib/vcloud/core/edge_gateway_interface.rb
vcloud-core-1.1.0 lib/vcloud/core/edge_gateway_interface.rb
vcloud-core-1.0.2 lib/vcloud/core/edge_gateway_interface.rb
vcloud-core-1.0.1 lib/vcloud/core/edge_gateway_interface.rb
vcloud-core-1.0.0 lib/vcloud/core/edge_gateway_interface.rb
vcloud-core-0.16.1 lib/vcloud/core/edge_gateway_interface.rb
vcloud-core-0.16.0 lib/vcloud/core/edge_gateway_interface.rb
vcloud-core-0.15.0 lib/vcloud/core/edge_gateway_interface.rb
vcloud-core-0.14.0 lib/vcloud/core/edge_gateway_interface.rb