mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Merge pull request #2515 from 12spokes/digitalocean-created-at
[digitalocean|compute] Add created_at timestamp as attribute of server
This commit is contained in:
commit
732db3efd7
6 changed files with 8 additions and 4 deletions
lib/fog/digitalocean
tests/digitalocean
|
@ -19,6 +19,7 @@ module Fog
|
|||
attribute :public_ip_address, :aliases => 'ip_address'
|
||||
attribute :private_ip_address
|
||||
attribute :backups_active
|
||||
attribute :created_at
|
||||
|
||||
attr_writer :ssh_keys
|
||||
|
||||
|
|
|
@ -54,7 +54,8 @@ module Fog
|
|||
"image_id" => image_id,
|
||||
"region_id" => region_id,
|
||||
"ip_address" => "127.0.0.1",
|
||||
"status" => 'active'
|
||||
"status" => 'active',
|
||||
"created_at" => Time.now.strftime("%FT%TZ")
|
||||
}
|
||||
|
||||
response.body = {
|
||||
|
|
|
@ -5,7 +5,7 @@ def service
|
|||
end
|
||||
|
||||
def fog_test_server_attributes
|
||||
image = service.images.find { |i| i.name == 'Ubuntu 12.04 x64' }
|
||||
image = service.images.find { |i| i.name == 'Ubuntu 13.10 x64' }
|
||||
region = service.regions.find { |r| r.name == 'New York 1' }
|
||||
flavor = service.flavors.find { |r| r.name == '512MB' }
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@ Shindo.tests("Fog::Compute[:digitalocean] | server model", ['digitalocean', 'com
|
|||
:flavor_id,
|
||||
:region_id,
|
||||
:image_id,
|
||||
:created_at,
|
||||
:ssh_keys=
|
||||
]
|
||||
tests("The server model should respond to") do
|
||||
|
|
|
@ -13,7 +13,7 @@ Shindo.tests('Fog::Compute[:digitalocean] | create_server request', ['digitaloce
|
|||
tests('success') do
|
||||
|
||||
tests('#create_server').formats({'status' => 'OK', 'droplet' => @server_format}) do
|
||||
image = service.images.find { |img| img.name == 'Ubuntu 12.04 x64' }
|
||||
image = service.images.find { |img| img.name == 'Ubuntu 13.10 x64' }
|
||||
flavor = service.flavors.find { |f| f.name == '512MB' }
|
||||
data = Fog::Compute[:digitalocean].create_server fog_server_name,
|
||||
flavor.id,
|
||||
|
|
|
@ -8,7 +8,8 @@ Shindo.tests('Fog::Compute[:digitalocean] | list_servers request', ['digitalocea
|
|||
'region_id' => Integer,
|
||||
'backups_active' => Fog::Nullable::Boolean,
|
||||
'ip_address' => Fog::Nullable::String,
|
||||
'status' => String
|
||||
'status' => String,
|
||||
'created_at' => String
|
||||
}
|
||||
|
||||
tests('success') do
|
||||
|
|
Loading…
Add table
Reference in a new issue