class Fog::Libvirt::Compute::Nic

Constants

TYPES

Attributes

server[RW]

Public Class Methods

new(attributes) click to toggle source
Calls superclass method
# File lib/fog/libvirt/models/compute/nic.rb, line 22
def initialize attributes
  super defaults.merge(attributes)
  raise Fog::Errors::Error.new("#{type} is not a supported nic type") if new? && !TYPES.include?(type)
end

Public Instance Methods

destroy() click to toggle source
# File lib/fog/libvirt/models/compute/nic.rb, line 33
def destroy
  raise Fog::Errors::Error.new('Destroying an interface is not yet implemented. Contributions welcome!')
  #requires :server
  ##detach the nic
  #service.detach_nic(domain, mac)
end
new?() click to toggle source
# File lib/fog/libvirt/models/compute/nic.rb, line 18
def new?
  mac.nil?
end
save() click to toggle source
# File lib/fog/libvirt/models/compute/nic.rb, line 27
def save
  raise Fog::Errors::Error.new('Creating a new nic is not yet implemented. Contributions welcome!')
  #requires :server
  #service.attach_nic(domain , self)
end

Private Instance Methods

defaults() click to toggle source
# File lib/fog/libvirt/models/compute/nic.rb, line 41
def defaults
  {
    :type  => "bridge",
    :model => "virtio"
  }
end