mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Merge branch 'master' of github.com:jamesrose/fog
This commit is contained in:
commit
fb10d1982b
2 changed files with 55 additions and 0 deletions
30
lib/fog/serverlove/models/compute/disk.rb
Normal file
30
lib/fog/serverlove/models/compute/disk.rb
Normal file
|
@ -0,0 +1,30 @@
|
|||
require 'fog/core/model'
|
||||
|
||||
module Fog
|
||||
module Compute
|
||||
class Serverlove
|
||||
|
||||
class Disk < Fog::Model
|
||||
|
||||
identity :drive
|
||||
|
||||
attribute :name
|
||||
attribute :user
|
||||
attribute :size
|
||||
attribute :claimed
|
||||
attribute :status
|
||||
attribute :encryption:cipher
|
||||
|
||||
def save
|
||||
# TODO
|
||||
end
|
||||
|
||||
def destroy
|
||||
requires :identity
|
||||
connection.destroy_disk(identity)
|
||||
true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
25
lib/fog/serverlove/models/compute/disks.rb
Normal file
25
lib/fog/serverlove/models/compute/disks.rb
Normal file
|
@ -0,0 +1,25 @@
|
|||
require 'fog/core/collection'
|
||||
require 'fog/serverlove/models/compute/disk'
|
||||
|
||||
module Fog
|
||||
module Compute
|
||||
class Serverlove
|
||||
|
||||
class Disks < Fog::Collection
|
||||
|
||||
model Fog::Compute::Serverlove::Disk
|
||||
|
||||
def all
|
||||
data = connection.get_disks.body['disks']
|
||||
load(data)
|
||||
end
|
||||
|
||||
def get(disk_id)
|
||||
connection.get_disk(image_id)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Reference in a new issue