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
Andrew Brown 2702f22e33 Improved OpenNebula support
This patch improves Fog's OpenNebula support in a number of ways:
Better NIC support in VM templates
Better ability to tune number of CPUs and memory
Ability to add/remove entries from a VM template's context section
Ability to add/remove entries from a VM template's user variables
Improved filtering for templates and NICs
2014-11-11 14:59:27 -05:00

42 lines
941 B
Ruby

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
def description
attributes[:description] || ""
end
def vlan
attributes[:vlan] || ""
end
def save
raise Fog::Errors::Error.new('Creating a new network is not yet implemented. Contributions welcome!')
end
def shutdown
raise Fog::Errors::Error.new('Shutting down a new network is not yet implemented. Contributions welcome!')
end
def to_label
ret = ""
ret += "#{description} - " unless description.empty?
ret += "VLAN #{vlan} - " unless vlan.empty?
ret += "#{name}"
end
end
end
end
end