1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

Made steps to get update/create working. Work in progress.

This commit is contained in:
seanhandley 2012-04-27 21:53:39 +01:00
parent d4863eb29d
commit 4331d171ee
4 changed files with 41 additions and 2 deletions

View file

@ -11,6 +11,8 @@ module Fog
request_path 'fog/serverlove/requests/compute'
request :get_drives
request :destroy_drive
request :create_drive
request :update_drive
model_path 'fog/serverlove/models/compute'
model :drive
@ -66,4 +68,4 @@ module Fog
end
end
end
end

View file

@ -16,7 +16,15 @@ module Fog
attribute :encryption_cipher, :aliases => 'encryption:cipher'
def save
# TODO
requires :identity
connection.update_drive(identity, attributes)
true
end
def create(attributes)
requires :name
connection.create_drive(attributes)
true
end
def destroy

View file

@ -0,0 +1,14 @@
module Fog
module Compute
class Serverlove
class Real
def create_drive(options)
return nil if options.empty? || options.nil?
request(:method => "post", :path => "/drives/create", :expects => 200, :options => options)
end
end
end
end
end

View file

@ -0,0 +1,15 @@
module Fog
module Compute
class Serverlove
class Real
def update_drive(identifier, options)
return nil if identifier.nil? || identifier == ""
return nil if options.empty? || options.nil?
request(:method => "post", :path => "/drives/#{identifier}/set", :expects => 200, :options => options)
end
end
end
end
end