class Fog::Libvirt::Compute::Pool
Attributes
xml[R]
Public Class Methods
new(attributes={} )
click to toggle source
Calls superclass method
# File lib/fog/libvirt/models/compute/pool.rb, line 20 def initialize(attributes={} ) # Can be created by passing in XML @xml = attributes.delete(:xml) super(attributes) end
Public Instance Methods
active?()
click to toggle source
Is the pool active or not?
# File lib/fog/libvirt/models/compute/pool.rb, line 63 def active? active end
auto_start?()
click to toggle source
Will the pool autostart or not?
# File lib/fog/libvirt/models/compute/pool.rb, line 68 def auto_start? autostart end
build()
click to toggle source
Build this storage pool
# File lib/fog/libvirt/models/compute/pool.rb, line 50 def build service.pool_action uuid, :build end
destroy()
click to toggle source
Destroys the storage pool
# File lib/fog/libvirt/models/compute/pool.rb, line 55 def destroy # Shutdown pool if active service.pool_action uuid, :destroy if active? # If this is a persistent domain we need to undefine it service.pool_action uuid, :undefine if persistent? end
persistent?()
click to toggle source
Is the pool persistent or not?
# File lib/fog/libvirt/models/compute/pool.rb, line 73 def persistent? persistent end
save()
click to toggle source
# File lib/fog/libvirt/models/compute/pool.rb, line 26 def save raise Fog::Errors::Error.new('Creating a new pool requires proper xml') unless xml self.uuid = (persistent ? service.define_pool(xml) : service.create_pool(xml)).uuid reload end
shutdown()
click to toggle source
Shuts down the pool
# File lib/fog/libvirt/models/compute/pool.rb, line 45 def shutdown stop end
start()
click to toggle source
Start the pool = make it active Performs a libvirt create (= start)
# File lib/fog/libvirt/models/compute/pool.rb, line 34 def start service.pool_action uuid, :create end
stop()
click to toggle source
Stop the pool = make it non-active Performs a libvirt destroy (= stop)
# File lib/fog/libvirt/models/compute/pool.rb, line 40 def stop service.pool_action uuid, :destroy end
volumes()
click to toggle source
Retrieves the volumes of this pool
# File lib/fog/libvirt/models/compute/pool.rb, line 78 def volumes service.list_pool_volumes uuid end