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:
parent
d4863eb29d
commit
4331d171ee
4 changed files with 41 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
14
lib/fog/serverlove/requests/compute/create_drive.rb
Normal file
14
lib/fog/serverlove/requests/compute/create_drive.rb
Normal 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
|
15
lib/fog/serverlove/requests/compute/update_drive.rb
Normal file
15
lib/fog/serverlove/requests/compute/update_drive.rb
Normal 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
|
Loading…
Add table
Reference in a new issue