mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[xenserver] Consoles collection created
This commit is contained in:
parent
58aba87c81
commit
96f9fae02d
1 changed files with 25 additions and 0 deletions
25
lib/fog/xenserver/models/compute/consoles.rb
Normal file
25
lib/fog/xenserver/models/compute/consoles.rb
Normal file
|
@ -0,0 +1,25 @@
|
|||
require 'fog/core/collection'
|
||||
require 'fog/xenserver/models/compute/console'
|
||||
|
||||
module Fog
|
||||
module Compute
|
||||
class XenServer
|
||||
class Consoles < Fog::Collection
|
||||
model Fog::Compute::XenServer::Console
|
||||
|
||||
def all(options={})
|
||||
data = service.get_records 'console'
|
||||
load(data)
|
||||
end
|
||||
|
||||
def get( console_ref )
|
||||
if console_ref && console = service.get_record( console_ref, 'console' )
|
||||
new(console)
|
||||
else
|
||||
nil
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue