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



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

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

#map(destination) ⇒ Object



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

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)


41
42
43
# File 'lib/fog/brightbox/models/compute/cloud_ip.rb', line 41

def mapped?
  status == "mapped"
end

#unmapObject



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

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