Sha256: 3be8d1a70b54c7eadba6a8213785af08a831a32c47a783d18763b58cc2dfee27

Contents?: true

Size: 662 Bytes

Versions: 7

Compression:

Stored size: 662 Bytes

Contents

require 'fog/core/collection'
require 'fog/compute/models/brightbox/cloud_ip'

module Fog
  module Compute
    class Brightbox

      class CloudIps < Fog::Collection

        model Fog::Compute::Brightbox::CloudIp

        def all
          data = connection.list_cloud_ips
          load(data)
        end

        def get(identifier)
          return nil if identifier.nil? || identifier == ""
          data = connection.get_cloud_ip(identifier)
          new(data)
        rescue Excon::Errors::NotFound
          nil
        end

        def allocate
          data = connection.create_cloud_ip
          new(data)
        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/brightbox/cloud_ips.rb
brightbox-cli-0.13.0 lib/brightbox-cli/vendor/fog/lib/fog/compute/models/brightbox/cloud_ips.rb
fog-0.11.0 lib/fog/compute/models/brightbox/cloud_ips.rb
fog-0.10.0 lib/fog/compute/models/brightbox/cloud_ips.rb
fog4encbs-0.9.0.1 lib/fog/compute/models/brightbox/cloud_ips.rb
fog4encbs-0.9.0 lib/fog/compute/models/brightbox/cloud_ips.rb
fog-0.9.0 lib/fog/compute/models/brightbox/cloud_ips.rb