Parent

Class/Module Index [+]

Quicksearch

Fog::Compute::OpenStack::Address

Public Class Methods

new(attributes = {}) click to toggle source
# File lib/fog/openstack/models/compute/address.rb, line 16
def initialize(attributes = {})
  # assign server first to prevent race condition with persisted?
  self.server = attributes.delete(:server)
  super
end

Public Instance Methods

destroy() click to toggle source
# File lib/fog/openstack/models/compute/address.rb, line 22
def destroy
  requires :id
  service.release_address(id)
  true
end
save() click to toggle source
# File lib/fog/openstack/models/compute/address.rb, line 36
def save
  raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if persisted?
  data = service.allocate_address(pool).body['floating_ip']
  new_attributes = data.reject {|key,value| !['id', 'instance_id', 'ip', 'fixed_ip'].include?(key)}
  merge_attributes(new_attributes)
  if @server
    self.server = @server
  end
  true
end
server=(new_server) click to toggle source
# File lib/fog/openstack/models/compute/address.rb, line 28
def server=(new_server)
  if new_server
    associate(new_server)
  else
    disassociate
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.