Class: Fog::Compute::XenServer::StorageRepository
- Inherits:
-
Model
- Object
- Model
- Fog::Compute::XenServer::StorageRepository
show all
- Defined in:
- lib/fog/xenserver/models/compute/storage_repository.rb
Instance Attribute Summary
Attributes inherited from Model
#collection, #service
Instance Method Summary
collapse
Methods inherited from Model
#initialize, #inspect, #reload, #symbolize_keys, #to_json, #wait_for
#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes
#connection, #connection=, #prepare_service_value
#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #persisted?, #requires, #requires_one
Constructor Details
This class inherits a constructor from Fog::Model
Instance Method Details
#destroy ⇒ Object
46
47
48
|
# File 'lib/fog/xenserver/models/compute/storage_repository.rb', line 46
def destroy
service.destroy_sr reference
end
|
#pbds ⇒ Object
37
38
39
|
# File 'lib/fog/xenserver/models/compute/storage_repository.rb', line 37
def pbds
__pbds.collect { |pbd| service.pbds.get pbd }
end
|
#save ⇒ Object
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
# File 'lib/fog/xenserver/models/compute/storage_repository.rb', line 50
def save
requires :name
requires :type
host = attributes[:host]
raise ArgumentError.new('host is required for this operation') unless
host
device_config = attributes[:device_config]
attr = service.get_record(
service.create_sr( host.reference,
name,
type,
description || '',
device_config || {},
physical_size || '0',
content_type || 'user',
shared || false,
sm_config || {}),
'SR'
)
merge_attributes attr
true
end
|
#scan ⇒ Object
41
42
43
44
|
# File 'lib/fog/xenserver/models/compute/storage_repository.rb', line 41
def scan
service.scan_sr reference
reload
end
|
#set_attribute(name, *val) ⇒ Object
81
82
83
84
85
86
87
|
# File 'lib/fog/xenserver/models/compute/storage_repository.rb', line 81
def set_attribute(name, *val)
data = service.set_attribute( 'SR', reference, name, *val )
end
|
#vdis ⇒ Object
33
34
35
|
# File 'lib/fog/xenserver/models/compute/storage_repository.rb', line 33
def vdis
__vdis.collect { |vdi| service.vdis.get vdi }
end
|