Sha256: 5910c0a7c423d937dedf6f2b6795204de02a4766fdd8100ecb6870dab7b601dd

Contents?: true

Size: 977 Bytes

Versions: 39

Compression:

Stored size: 977 Bytes

Contents

require 'fog/core/model'

module Fog
  module Network
    class OpenStack
      class FloatingIp < Fog::Model
        identity :id

        attribute :floating_network_id
        attribute :port_id
        attribute :tenant_id
        attribute :fixed_ip_address
        attribute :floating_ip_address






        def initialize(attributes)
          @connection = attributes[:connection]
          super
        end

        def save
          requires :floating_network_id
          identity ? update : create
        end

        def create
          requires :floating_network_id
          merge_attributes(service.create_floating_ip(self.floating_network_id,


                                                    self.attributes).body['floatingip'])
          self
        end

        def update
          self
        end

        def destroy
          requires :id
          service.delete_floating_ip(self.id)
          true
        end

      end
    end
  end
end

Version data entries

39 entries across 39 versions & 2 rubygems

Version Path
fog-1.22.0 lib/fog/openstack/models/network/floating_ip.rb
fog-1.21.0 lib/fog/openstack/models/network/floating_ip.rb
fog-maestrodev-1.20.0.20140305101839 lib/fog/openstack/models/network/floating_ip.rb
fog-maestrodev-1.20.0.20140305101305 lib/fog/openstack/models/network/floating_ip.rb
fog-maestrodev-1.19.0.20140212012611 lib/fog/openstack/models/network/floating_ip.rb
fog-1.20.0 lib/fog/openstack/models/network/floating_ip.rb
fog-maestrodev-1.19.0.20140110004459 lib/fog/openstack/models/network/floating_ip.rb
fog-maestrodev-1.19.0.20140110003812 lib/fog/openstack/models/network/floating_ip.rb
fog-maestrodev-1.19.0.20140109202555 lib/fog/openstack/models/network/floating_ip.rb
fog-maestrodev-1.19.0.20140107192102 lib/fog/openstack/models/network/floating_ip.rb
fog-maestrodev-1.19.0.20140107142106 lib/fog/openstack/models/network/floating_ip.rb
fog-maestrodev-1.19.0.20131219203941 lib/fog/openstack/models/network/floating_ip.rb
fog-maestrodev-1.18.0.20131219193542 lib/fog/openstack/models/network/floating_ip.rb
fog-1.19.0 lib/fog/openstack/models/network/floating_ip.rb
fog-maestrodev-1.18.0.20131219033443 lib/fog/openstack/models/network/floating_ip.rb
fog-maestrodev-1.18.0.20131219032002 lib/fog/openstack/models/network/floating_ip.rb
fog-maestrodev-1.18.0.20131219030716 lib/fog/openstack/models/network/floating_ip.rb
fog-maestrodev-1.18.0.20131219022322 lib/fog/openstack/models/network/floating_ip.rb
fog-maestrodev-1.18.0.20131218202447 lib/fog/openstack/models/network/floating_ip.rb
fog-maestrodev-1.18.0.20131209091424 lib/fog/openstack/models/network/floating_ip.rb