Class: Fog::Compute::Brightbox::CloudIp
Instance Method Summary
collapse
#collection_name, #resource_name
Instance Method Details
#destination_id ⇒ Object
60
61
62
|
# File 'lib/fog/brightbox/models/compute/cloud_ip.rb', line 60
def destination_id
server_id || load_balancer || server_group || database_server || interface_id
end
|
#destroy ⇒ Object
55
56
57
58
|
# File 'lib/fog/brightbox/models/compute/cloud_ip.rb', line 55
def destroy
requires :identity
service.destroy_cloud_ip(identity)
end
|
#map(destination) ⇒ Object
Attempt to map or point the Cloud IP to the destination resource.
34
35
36
37
38
39
40
41
42
43
44
|
# File 'lib/fog/brightbox/models/compute/cloud_ip.rb', line 34
def map(destination)
requires :identity
if destination.respond_to?(:mapping_identity)
final_destination = destination.mapping_identity
elsif destination.respond_to?(:identity)
final_destination = destination.identity
else
final_destination = destination
end
service.map_cloud_ip(identity, :destination => final_destination)
end
|
#mapped? ⇒ Boolean
46
47
48
|
# File 'lib/fog/brightbox/models/compute/cloud_ip.rb', line 46
def mapped?
status == "mapped"
end
|
#unmap ⇒ Object
50
51
52
53
|
# File 'lib/fog/brightbox/models/compute/cloud_ip.rb', line 50
def unmap
requires :identity
service.unmap_cloud_ip(identity)
end
|