Sha256: 6c980041e3f8a6cbde8314383e244d28de03d274e248b730a35d7657d62e4d63

Contents?: true

Size: 841 Bytes

Versions: 21

Compression:

Stored size: 841 Bytes

Contents

require 'fog/core/collection'
require 'fog/cloudstack/models/compute/public_ip_address'

module Fog
  module Compute
    class Cloudstack
      class PublicIpAddresses < Fog::Collection
        model Fog::Compute::Cloudstack::PublicIpAddress

        def all(options = {})
          response = service.list_public_ip_addresses(options)
          public_ip_addresses = response["listpublicipaddressesresponse"]["publicipaddress"] || []
          load(public_ip_addresses)
        end

        def get(address_id)
          response = service.list_public_ip_addresses('id' => address_id)
          if public_ip_address = response["listpublicipaddressesresponse"]["publicipaddress"].first
            new(public_ip_address)
          end
        rescue Fog::Compute::Cloudstack::BadRequest
          nil
        end
      end
    end
  end
end

Version data entries

21 entries across 19 versions & 3 rubygems

Version Path
fog-2.1.0 lib/fog/cloudstack/models/compute/public_ip_addresses.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-1.42.1/lib/fog/cloudstack/models/compute/public_ip_addresses.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-1.42.1/lib/fog/cloudstack/models/compute/public_ip_addresses.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-1.42.1/lib/fog/cloudstack/models/compute/public_ip_addresses.rb
fog-1.42.1 lib/fog/cloudstack/models/compute/public_ip_addresses.rb
fog-2.0.0 lib/fog/cloudstack/models/compute/public_ip_addresses.rb
fog-1.42.0 lib/fog/cloudstack/models/compute/public_ip_addresses.rb
fog-1.41.0 lib/fog/cloudstack/models/compute/public_ip_addresses.rb
fog-1.40.0 lib/fog/cloudstack/models/compute/public_ip_addresses.rb
fog-1.39.0 lib/fog/cloudstack/models/compute/public_ip_addresses.rb
fog-1.38.0 lib/fog/cloudstack/models/compute/public_ip_addresses.rb
fog-1.37.0 lib/fog/cloudstack/models/compute/public_ip_addresses.rb
fog-1.36.0 lib/fog/cloudstack/models/compute/public_ip_addresses.rb
fog-1.35.0 lib/fog/cloudstack/models/compute/public_ip_addresses.rb
fog-2.0.0.pre.0 lib/fog/cloudstack/models/compute/public_ip_addresses.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/lib/fog/cloudstack/models/compute/public_ip_addresses.rb
fog-1.34.0 lib/fog/cloudstack/models/compute/public_ip_addresses.rb
fog-1.33.0 lib/fog/cloudstack/models/compute/public_ip_addresses.rb
fog-1.32.0 lib/fog/cloudstack/models/compute/public_ip_addresses.rb
fog-1.31.0 lib/fog/cloudstack/models/compute/public_ip_addresses.rb