mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
![Paul Thornthwaite](/assets/img/avatar_default.png)
* Request tests for accounts, api_clients, cloud_ips, images, interfaces, server types, user and zones * Added 'ready?' methods to CloudIp and Image models * Reworked brightbox helper to include Format patterns for all of the * Added "hack" to allow select objects to be one class OR NilClass for fields that may be a JSON string or null if unset * Some tests are not enabled (commented out) because they need manual steps (such as uploading Image to your account before registration)
47 lines
1,002 B
Ruby
47 lines
1,002 B
Ruby
require 'fog/core/model'
|
|
|
|
module Fog
|
|
module Brightbox
|
|
class Compute
|
|
|
|
class CloudIp < Fog::Model
|
|
|
|
identity :id
|
|
|
|
attribute :url
|
|
attribute :name
|
|
attribute :status
|
|
attribute :resource_type
|
|
attribute :description
|
|
|
|
attribute :reverse_dns
|
|
attribute :public_ip
|
|
|
|
attribute :account_id, :aliases => "account", :squash => "id"
|
|
attribute :interface_id, :aliases => "interface", :squash => "id"
|
|
attribute :server_id, :aliases => "server", :squash => "id"
|
|
|
|
def map(interface_to_map)
|
|
requires :identity
|
|
connection.map_cloud_ip(identity, :interface => interface_to_map)
|
|
end
|
|
|
|
def mapped?
|
|
status == "mapped"
|
|
end
|
|
|
|
def unmap
|
|
requires :identity
|
|
connection.unmap_cloud_ip(identity)
|
|
end
|
|
|
|
def destroy
|
|
requires :identity
|
|
connection.destroy_cloud_ip(identity)
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
end
|
|
end
|