mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
2702f22e33
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
42 lines
941 B
Ruby
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
|