Class: Fog::Compute::Brightbox::CloudIp

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/brightbox/models/compute/cloud_ip.rb

Instance Attribute Summary

Attributes inherited from Model

#collection, #connection

Instance Method Summary collapse

Methods inherited from Model

#initialize, #inspect, #reload, #symbolize_keys, #to_json, #wait_for

Methods included from Attributes::ClassMethods

#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes

Methods included from Attributes::InstanceMethods

#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #requires, #requires_one

Constructor Details

This class inherits a constructor from Fog::Model

Instance Method Details

#destroyObject



48
49
50
51
# File 'lib/fog/brightbox/models/compute/cloud_ip.rb', line 48

def destroy
  requires :identity
  connection.destroy_cloud_ip(identity)
end

#map(destination) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/fog/brightbox/models/compute/cloud_ip.rb', line 26

def map(destination)
  requires :identity
  case destination
  when Fog::Compute::Brightbox::Server
    final_destination = destination.interfaces.first["id"]
  when Fog::Compute::Brightbox::LoadBalancer
    final_destination = destination.id
  else
    final_destination = destination
  end
  connection.map_cloud_ip(identity, :destination => final_destination)
end

#mapped?Boolean

Returns:

  • (Boolean)


39
40
41
# File 'lib/fog/brightbox/models/compute/cloud_ip.rb', line 39

def mapped?
  status == "mapped"
end

#unmapObject



43
44
45
46
# File 'lib/fog/brightbox/models/compute/cloud_ip.rb', line 43

def unmap
  requires :identity
  connection.unmap_cloud_ip(identity)
end