1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/lib/fog/opennebula/models/compute/network.rb

43 lines
941 B
Ruby
Raw Normal View History

require 'fog/core/model'
module Fog
module Compute
class OpenNebula
class Network < Fog::Model
identity :id
attribute :name
attribute :uname
attribute :uid
attribute :gid
attribute :description
attribute :vlan
2014-05-15 13:54:57 +02:00
def description
attributes[:description] || ""
2014-05-15 13:54:57 +02:00
end
2014-05-15 13:54:57 +02:00
def vlan
attributes[:vlan] || ""
2014-05-15 13:54:57 +02:00
end
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!')
end
2014-05-15 13:54:57 +02:00
def to_label
ret = ""
ret += "#{description} - " unless description.empty?
ret += "VLAN #{vlan} - " unless vlan.empty?
ret += "#{name}"
2014-05-15 13:54:57 +02:00
end
end
end
end
end