diff --git a/lib/fog/rackspace/requests/servers/get_image_details.rb b/lib/fog/rackspace/requests/servers/get_image_details.rb new file mode 100644 index 000000000..23608b881 --- /dev/null +++ b/lib/fog/rackspace/requests/servers/get_image_details.rb @@ -0,0 +1,35 @@ +module Fog + module Rackspace + module Servers + class Real + + # Get details for image by id + # + # ==== Returns + # * response<~Excon::Response>: + # * body<~Hash>: + # * 'id'<~Integer> - Id of the image + # * 'name'<~String> - Name of the image + # * 'serverId'<~Integer> - Id of server image was created from + # * 'status'<~Integer> - Status of image + # * 'updated'<~String> - Timestamp of last update + def get_image_details(image_id) + request( + :expects => [200, 203], + :method => 'GET', + :path => "images/#{image_id}.json" + ) + end + + end + + class Mock + + def get_image_details(image_id) + raise MockNotImplemented.new("Contributions welcome!") + end + + end + end + end +end diff --git a/lib/fog/rackspace/servers.rb b/lib/fog/rackspace/servers.rb index 5f840327c..81c86709c 100644 --- a/lib/fog/rackspace/servers.rb +++ b/lib/fog/rackspace/servers.rb @@ -15,6 +15,7 @@ module Fog require 'fog/rackspace/requests/servers/delete_image' require 'fog/rackspace/requests/servers/delete_server' require 'fog/rackspace/requests/servers/get_flavor_details' + require 'fog/rackspace/requests/servers/get_image_details' require 'fog/rackspace/requests/servers/get_server_details' require 'fog/rackspace/requests/servers/list_addresses' require 'fog/rackspace/requests/servers/list_private_addresses'