2012-04-02 13:25:03 +02:00
|
|
|
require 'fog/core/model'
|
|
|
|
|
|
|
|
module Fog
|
|
|
|
module Compute
|
|
|
|
class XenServer
|
|
|
|
|
|
|
|
class VBD < Fog::Model
|
|
|
|
# API Reference here:
|
|
|
|
# http://docs.vmd.citrix.com/XenServer/5.6.0/1.0/en_gb/api/?c=VBD
|
|
|
|
|
|
|
|
identity :reference
|
|
|
|
|
|
|
|
attribute :uuid
|
|
|
|
attribute :currently_attached
|
2012-04-04 19:48:21 +02:00
|
|
|
attribute :allowed_operations
|
|
|
|
attribute :current_operations
|
2012-04-02 13:25:03 +02:00
|
|
|
attribute :reserved
|
2012-04-02 13:48:04 +02:00
|
|
|
attribute :__vdi, :aliases => :VDI
|
|
|
|
attribute :__vm, :aliases => :VM
|
2012-04-02 13:25:03 +02:00
|
|
|
attribute :device
|
|
|
|
attribute :status_detail
|
2012-04-04 19:48:21 +02:00
|
|
|
attribute :status_code
|
2012-04-02 13:25:03 +02:00
|
|
|
attribute :type
|
|
|
|
attribute :userdevice
|
2012-04-04 19:48:21 +02:00
|
|
|
attribute :empty
|
|
|
|
attribute :type
|
|
|
|
attribute :mode
|
|
|
|
attribute :runtime_properties
|
|
|
|
attribute :unpluggable
|
|
|
|
|
2012-04-04 09:01:55 +02:00
|
|
|
#
|
|
|
|
# May return nil
|
|
|
|
#
|
2012-04-02 13:25:03 +02:00
|
|
|
def vdi
|
|
|
|
connection.vdis.get __vdi
|
|
|
|
end
|
2012-04-02 13:48:04 +02:00
|
|
|
|
2012-04-04 09:01:55 +02:00
|
|
|
#
|
|
|
|
# TODO: May it return nil?
|
|
|
|
#
|
2012-04-02 13:48:04 +02:00
|
|
|
def server
|
|
|
|
connection.servers.get __vm
|
|
|
|
end
|
2012-04-02 13:25:03 +02:00
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|