-
-
Notifications
You must be signed in to change notification settings - Fork 22
/
vbd.rb
49 lines (43 loc) · 1.64 KB
/
vbd.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
module Fog
module Compute
class XenServer
module Models
class Vbd < Fog::Model
# API Reference here:
# http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/api/?c=VBD
provider_class :VBD
identity :reference
attribute :allowed_operations
attribute :bootable, :default => true
attribute :currently_attached
attribute :current_operations
attribute :device
attribute :empty, :default => false
attribute :mode, :default => 'RW'
attribute :other_config, :default => { 'owner' => '' }
attribute :qos_supported_algorithms, :default => []
attribute :qos_algorithm_params, :default => {}
attribute :qos_algorithm_type, :default => ''
attribute :runtime_properties
attribute :status_code
attribute :status_detail
attribute :storage_lock
attribute :type, :default => 'Disk'
attribute :unpluggable
attribute :userdevice, :default => '0'
attribute :uuid
has_one :metrics, :vbds_metrics
has_one :vdi, :vdis, :aliases => :VDI
has_one :vm, :servers, :aliases => :VM
alias_method :server, :vm
def save
requires :vdi, :server
ref = service.create_vbd(server, vdi, attributes)
merge_attributes(service.vbds.get(ref).attributes)
true
end
end
end
end
end
end