# File lib/fog/xenserver/models/compute/storage_repository.rb, line 43 def destroy service.destroy_sr reference end
# File lib/fog/xenserver/models/compute/storage_repository.rb, line 34 def pbds __pbds.collect { |pbd| service.pbds.get pbd } end
# File lib/fog/xenserver/models/compute/storage_repository.rb, line 47 def save requires :name requires :type # host is not a model attribute (not in XAPI at least), # but we need it here host = attributes[:host] raise ArgumentError.new('host is required for this operation') unless host # Not sure if this is always required, so not raising exception if nil device_config = attributes[:device_config] # create_sr request provides sane defaults if some attributes are # missing 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
# File lib/fog/xenserver/models/compute/storage_repository.rb, line 38 def scan service.scan_sr reference reload end
# File lib/fog/xenserver/models/compute/storage_repository.rb, line 78 def set_attribute(name, *val) data = service.set_attribute( 'SR', reference, name, *val ) # Do not reload automatically for performance reasons # We can set multiple attributes at the same time and # then reload manually #reload end
Generated with the Darkfish Rdoc Generator 2.