36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
# File 'lib/fog/rackspace/requests/compute_v2/create_image.rb', line 36
def create_image(server_id, options = {})
response = Excon::Response.new
response.status = 202
now = Time.now
data = {
'created' => now,
'id' => Fog::Mock.random_numbers(6).to_i,
'name' => options['name'] || '',
'serverId' => server_id,
'status' => 'SAVING',
'updated' => now.to_s,
}
self.data[:last_modified][:images][data['id']] = now
self.data[:images][data['id']] = data
response.body = { 'image' => data.reject {|key, value| !['id', 'name', 'serverId', 'status', 'updated'].include?(key)} }
response
end
|