2011-06-28 15:47:16 +02:00
|
|
|
require 'fog/core/model'
|
|
|
|
|
|
|
|
module Fog
|
|
|
|
module Compute
|
|
|
|
class Libvirt
|
|
|
|
|
|
|
|
class Interface < Fog::Model
|
|
|
|
|
2011-08-03 12:48:44 +02:00
|
|
|
identity :name
|
2011-08-08 15:22:55 -06:00
|
|
|
|
2011-06-28 15:47:16 +02:00
|
|
|
attribute :mac
|
2011-09-12 20:11:58 +02:00
|
|
|
attribute :xml
|
2011-06-28 15:47:16 +02:00
|
|
|
|
2011-08-03 12:48:44 +02:00
|
|
|
def save
|
2011-08-08 15:30:09 -06:00
|
|
|
raise Fog::Errors::Error.new('Creating a new interface is not yet implemented. Contributions welcome!')
|
2011-08-03 12:48:44 +02:00
|
|
|
end
|
2011-08-08 15:22:55 -06:00
|
|
|
|
2011-06-28 15:47:16 +02:00
|
|
|
def destroy
|
|
|
|
requires :raw
|
|
|
|
raw.delete
|
|
|
|
true
|
|
|
|
end
|
2011-08-08 15:22:55 -06:00
|
|
|
|
2011-06-28 15:47:16 +02:00
|
|
|
private
|
|
|
|
|
|
|
|
def raw
|
|
|
|
@raw
|
|
|
|
end
|
|
|
|
|
|
|
|
def raw=(new_raw)
|
|
|
|
@raw = new_raw
|
|
|
|
|
2011-08-08 15:22:55 -06:00
|
|
|
raw_attributes = {
|
2011-06-28 15:47:16 +02:00
|
|
|
:name => new_raw.name,
|
|
|
|
:mac => new_raw.mac,
|
2011-09-12 20:11:58 +02:00
|
|
|
:xml => new_raw.xml_desc,
|
2011-06-28 15:47:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
merge_attributes(raw_attributes)
|
|
|
|
|
|
|
|
end
|
2011-08-08 15:22:55 -06:00
|
|
|
|
2011-06-28 15:47:16 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|