Parent

Class/Module Index [+]

Quicksearch

Fog::Compute::Libvirt::Pool

Attributes

xml[R]

Public Class Methods

new(attributes={} ) click to toggle source
# File lib/fog/libvirt/models/compute/pool.rb, line 21
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 64
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 69
def auto_start?
  autostart
end
build() click to toggle source

Build this storage pool

# File lib/fog/libvirt/models/compute/pool.rb, line 51
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 56
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 74
def persistent?
  persistent
end
save() click to toggle source
# File lib/fog/libvirt/models/compute/pool.rb, line 27
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 46
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 35
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 41
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 79
def volumes
  service.list_pool_volumes uuid
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.