Class: Fog::Rackspace::LoadBalancers::VirtualIp

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/rackspace/models/load_balancers/virtual_ip.rb

Instance Method Summary collapse

Instance Method Details

#destroyObject



13
14
15
16
17
# File 'lib/fog/rackspace/models/load_balancers/virtual_ip.rb', line 13

def destroy
  requires :identity, :load_balancer
  service.delete_virtual_ip(load_balancer.identity, identity)
  true
end

#saveObject

Raises:

  • (Fog::Errors::Error)


19
20
21
22
23
24
25
# File 'lib/fog/rackspace/models/load_balancers/virtual_ip.rb', line 19

def save
  raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if persisted?
  requires :load_balancer, :type
  data = service.create_virtual_ip(load_balancer.id, type)
  merge_attributes(data.body)
  true
end