Sha256: 4f0112ee2417c41844d965ecd1dfad3e34cb1570e644259cc2dc9f551391d1ae

Contents?: true

Size: 1.04 KB

Versions: 25

Compression:

Stored size: 1.04 KB

Contents

require 'fog/ecloud/models/compute/internet_service'

module Fog
  module Compute
    class Ecloud
      class InternetServices < Fog::Ecloud::Collection

        model Fog::Compute::Ecloud::InternetService

        attribute :href, :aliases => :Href

        def all
          check_href! :message => "the Internet Services for the Vdc you want to enumerate"
          if internet_service_data = connection.get_internet_services(href).body[:InternetService]
            load(Array[internet_service_data].flatten.find_all {|i| i[:IsBackupService] == "false" })
          end
        end

        # Optimize later, no need to get_internet_services again?
        def get(uri)
          internet_services = connection.get_internet_services(href).body[:InternetService]
          internet_services = [ internet_services ] if internet_services.is_a?(Hash)
          if data = internet_services.detect { |service| service[:Href] == uri }
            new(data)
          end
        rescue Fog::Errors::NotFound
          nil
        end

      end
    end
  end
end

Version data entries

25 entries across 25 versions & 7 rubygems

Version Path
brightbox-cli-0.18.1 lib/brightbox-cli/vendor/fog/lib/fog/ecloud/models/compute/internet_services.rb
michiels-fog-1.3.1 lib/fog/ecloud/models/compute/internet_services.rb
ftl-0.2.0 vendor/bundle/gems/fog-1.3.1/lib/fog/ecloud/models/compute/internet_services.rb
brightbox-cli-0.18.0 lib/brightbox-cli/vendor/fog/lib/fog/ecloud/models/compute/internet_services.rb
fog-1.3.1 lib/fog/ecloud/models/compute/internet_services.rb
fog-1.3.0 lib/fog/ecloud/models/compute/internet_services.rb
brightbox-cli-0.17.5 lib/brightbox-cli/vendor/fog/lib/fog/ecloud/models/compute/internet_services.rb
fog-1.2.0 lib/fog/ecloud/models/compute/internet_services.rb
ktheory-fog-1.1.2 lib/fog/ecloud/models/compute/internet_services.rb
brightbox-cli-0.17.4 lib/brightbox-cli/vendor/fog/lib/fog/ecloud/models/compute/internet_services.rb
brightbox-cli-0.17.3 lib/brightbox-cli/vendor/fog/lib/fog/ecloud/models/compute/internet_services.rb
brightbox-cli-0.17.2 lib/brightbox-cli/vendor/fog/lib/fog/ecloud/models/compute/internet_services.rb
brightbox-cli-0.17.1 lib/brightbox-cli/vendor/fog/lib/fog/ecloud/models/compute/internet_services.rb
brightbox-cli-0.17.0 lib/brightbox-cli/vendor/fog/lib/fog/ecloud/models/compute/internet_services.rb
fog-1.1.2 lib/fog/ecloud/models/compute/internet_services.rb
fog_tractical-1.1.4 lib/fog/ecloud/models/compute/internet_services.rb
fog_tractical-1.1.3 lib/fog/ecloud/models/compute/internet_services.rb
brightbox-cli-0.16.0 lib/brightbox-cli/vendor/fog/lib/fog/ecloud/models/compute/internet_services.rb
fog-1.1.1 lib/fog/ecloud/models/compute/internet_services.rb
fog-1.1.0 lib/fog/ecloud/models/compute/internet_services.rb