Sha256: 289e950ba67b528ffca2d3e1840cd7d029cb22fbb1c6ec6cb1fbfd085858bf0b

Contents?: true

Size: 1.09 KB

Versions: 13

Compression:

Stored size: 1.09 KB

Contents

require 'fog/vcloud/terremark/ecloud/models/backup_internet_service'

module Fog
  class Vcloud
    module Terremark
      class Ecloud

        class BackupInternetServices < Fog::Vcloud::Collection

          model Fog::Vcloud::Terremark::Ecloud::BackupInternetService

          attribute :href, :aliases => :Href

          def all
            check_href! :message => "the Internet Services for the Vdc you want to enumerate"
            if data = connection.get_internet_services(href).body[:InternetService].find_all {|i| i[:IsBackupService] == "true" }
              load(data)
            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
end

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
fog-0.5.3 lib/fog/vcloud/terremark/ecloud/models/backup_internet_services.rb
fog-0.5.2 lib/fog/vcloud/terremark/ecloud/models/backup_internet_services.rb
fog-0.5.1 lib/fog/vcloud/terremark/ecloud/models/backup_internet_services.rb
fog-0.5.0 lib/fog/vcloud/terremark/ecloud/models/backup_internet_services.rb
phpfog-fog-0.4.1.3 lib/fog/vcloud/terremark/ecloud/models/backup_internet_services.rb
phpfog-fog-0.4.1.2 lib/fog/vcloud/terremark/ecloud/models/backup_internet_services.rb
phpfog-fog-0.4.1.1 lib/fog/vcloud/terremark/ecloud/models/backup_internet_services.rb
phpfog-fog-0.4.1 lib/fog/vcloud/terremark/ecloud/models/backup_internet_services.rb
fog-0.4.1 lib/fog/vcloud/terremark/ecloud/models/backup_internet_services.rb
fog-0.4.0 lib/fog/vcloud/terremark/ecloud/models/backup_internet_services.rb
fog-0.3.34 lib/fog/vcloud/terremark/ecloud/models/backup_internet_services.rb
fog-0.3.33 lib/fog/vcloud/terremark/ecloud/models/backup_internet_services.rb
fog-0.3.32 lib/fog/vcloud/terremark/ecloud/models/backup_internet_services.rb