Sha256: 86a71f15e40091a1a1e73ef6ccabcafbcda1031de59f87f495de1c095fd49d96

Contents?: true

Size: 896 Bytes

Versions: 7

Compression:

Stored size: 896 Bytes

Contents

require 'fog/compute/models/ecloud/public_ip'

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

        undef_method :create

        attribute :href, :aliases => :Href

        model Fog::Compute::Ecloud::PublicIp

        #get_request :get_public_ip
        #vcloud_type "application/vnd.tmrk.ecloud.publicIp+xml"
        #all_request lambda { |public_ips| public_ips.connection.get_public_ips(public_ips.href) }

        def all
          check_href!(:message => "the Public Ips href of the Vdc you want to enumerate")
          if data = connection.get_public_ips(href).body[:PublicIPAddress]
            load(data)
          end
        end

        def get(uri)
          if data = connection.get_public_ip(uri)
            new(data.body)
          end
        rescue Fog::Errors::NotFound
          nil
        end

      end
    end
  end
end

Version data entries

7 entries across 7 versions & 3 rubygems

Version Path
brightbox-cli-0.13.1 lib/brightbox-cli/vendor/fog/lib/fog/compute/models/ecloud/public_ips.rb
brightbox-cli-0.13.0 lib/brightbox-cli/vendor/fog/lib/fog/compute/models/ecloud/public_ips.rb
fog-0.11.0 lib/fog/compute/models/ecloud/public_ips.rb
fog-0.10.0 lib/fog/compute/models/ecloud/public_ips.rb
fog4encbs-0.9.0.1 lib/fog/compute/models/ecloud/public_ips.rb
fog4encbs-0.9.0 lib/fog/compute/models/ecloud/public_ips.rb
fog-0.9.0 lib/fog/compute/models/ecloud/public_ips.rb