Class: Fog::Compute::Brightbox::CloudIp
Instance Method Summary
collapse
#collection_name, #resource_name
Instance Method Details
#destination_id ⇒ Object
57
58
59
|
# File 'lib/fog/brightbox/models/compute/cloud_ip.rb', line 57
def destination_id
server_id || load_balancer || server_group || database_server || interface_id
end
|
#destroy ⇒ Object
52
53
54
55
|
# File 'lib/fog/brightbox/models/compute/cloud_ip.rb', line 52
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.
31
32
33
34
35
36
37
38
39
40
41
|
# File 'lib/fog/brightbox/models/compute/cloud_ip.rb', line 31
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
43
44
45
|
# File 'lib/fog/brightbox/models/compute/cloud_ip.rb', line 43
def mapped?
status == "mapped"
end
|
#unmap ⇒ Object
47
48
49
50
|
# File 'lib/fog/brightbox/models/compute/cloud_ip.rb', line 47
def unmap
requires :identity
service.unmap_cloud_ip(identity)
end
|