Sha256: c3de049f42d4b81c5960c2dc9775e57595a92f7f61e5738056b8794cb7bc3254

Contents?: true

Size: 886 Bytes

Versions: 8

Compression:

Stored size: 886 Bytes

Contents

require 'fog/openstack/models/model'

module Fog
  module Network
    class OpenStack
      class FloatingIp < Fog::OpenStack::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 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

8 entries across 8 versions & 2 rubygems

Version Path
fog-openstack-0.1.2 lib/fog/openstack/models/network/floating_ip.rb
fog-openstack-0.1.0 lib/fog/openstack/models/network/floating_ip.rb
fog-1.37.0 lib/fog/openstack/models/network/floating_ip.rb
fog-1.36.0 lib/fog/openstack/models/network/floating_ip.rb
fog-1.35.0 lib/fog/openstack/models/network/floating_ip.rb
fog-2.0.0.pre.0 lib/fog/openstack/models/network/floating_ip.rb
fog-1.34.0 lib/fog/openstack/models/network/floating_ip.rb
fog-1.33.0 lib/fog/openstack/models/network/floating_ip.rb