2014-04-02 14:57:15 +02:00
|
|
|
require 'fog/core/model'
|
|
|
|
|
|
|
|
module Fog
|
|
|
|
module Compute
|
|
|
|
class OpenNebula
|
|
|
|
class Network < Fog::Model
|
|
|
|
|
2014-06-05 11:05:51 +02:00
|
|
|
identity :id
|
2014-04-02 14:57:15 +02:00
|
|
|
attribute :name
|
2014-11-07 13:50:11 -05:00
|
|
|
attribute :uname
|
2014-04-02 14:57:15 +02:00
|
|
|
attribute :uid
|
|
|
|
attribute :gid
|
2014-04-23 15:46:28 +02:00
|
|
|
attribute :description
|
|
|
|
attribute :vlan
|
2014-04-02 14:57:15 +02:00
|
|
|
|
2014-05-15 13:54:57 +02:00
|
|
|
def description
|
2014-06-05 10:27:34 +02:00
|
|
|
attributes[:description] || ""
|
2014-05-15 13:54:57 +02:00
|
|
|
end
|
2014-04-23 15:46:28 +02:00
|
|
|
|
2014-05-15 13:54:57 +02:00
|
|
|
def vlan
|
2014-06-05 10:27:34 +02:00
|
|
|
attributes[:vlan] || ""
|
2014-05-15 13:54:57 +02:00
|
|
|
end
|
2014-04-23 15:46:28 +02:00
|
|
|
|
2014-04-02 14:57:15 +02:00
|
|
|
def save
|
|
|
|
raise Fog::Errors::Error.new('Creating a new network is not yet implemented. Contributions welcome!')
|
|
|
|
end
|
|
|
|
|
|
|
|
def shutdown
|
2014-05-15 13:54:57 +02:00
|
|
|
raise Fog::Errors::Error.new('Shutting down a new network is not yet implemented. Contributions welcome!')
|
2014-04-02 14:57:15 +02:00
|
|
|
end
|
|
|
|
|
2014-05-15 13:54:57 +02:00
|
|
|
def to_label
|
|
|
|
ret = ""
|
|
|
|
ret += "#{description} - " unless description.empty?
|
|
|
|
ret += "VLAN #{vlan} - " unless vlan.empty?
|
2014-04-23 15:46:28 +02:00
|
|
|
ret += "#{name}"
|
2014-05-15 13:54:57 +02:00
|
|
|
end
|
2014-04-23 15:46:28 +02:00
|
|
|
|
2014-04-02 14:57:15 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|