[digitalocean] Add support for private networking

This commit is contained in:
Trae Robrock 2013-11-24 16:50:39 -08:00
parent 1c2ae5f527
commit 037d99b8bf
3 changed files with 10 additions and 3 deletions

View File

@ -17,6 +17,7 @@ module Fog
# Not documented in their API, but
# available nevertheless
attribute :public_ip_address, :aliases => 'ip_address'
attribute :private_ip_address
attribute :backups_active
attr_writer :ssh_keys
@ -124,6 +125,9 @@ module Fog
elsif @ssh_keys
options[:ssh_key_ids] = @ssh_keys.map(&:id)
end
options[:private_networking] = !!attributes[:private_networking]
data = service.create_server name,
flavor_id,
image_id,

View File

@ -24,6 +24,8 @@ module Fog
query_hash[:ssh_key_ids] = options[:ssh_key_ids]
end
query_hash[:private_networking] = !!options[:private_networking]
request(
:expects => [200],
:method => 'GET',

View File

@ -6,8 +6,8 @@ Shindo.tests("Fog::Compute[:digitalocean] | server model", ['digitalocean', 'com
tests('have the action') do
test('reload') { server.respond_to? 'reload' }
%w{
shutdown
%w{
shutdown
reboot
power_cycle
stop
@ -19,12 +19,13 @@ Shindo.tests("Fog::Compute[:digitalocean] | server model", ['digitalocean', 'com
tests('have attributes') do
model_attribute_hash = server.attributes
attributes = [
attributes = [
:id,
:name,
:state,
:backups_active,
:public_ip_address,
:private_ip_address,
:flavor_id,
:region_id,
:image_id,