Sha256: 2123e810040b3283e13ee1caa9ce3d1729eb3ce193e0c3ceb752258f2313734a

Contents?: true

Size: 916 Bytes

Versions: 12

Compression:

Stored size: 916 Bytes

Contents

require 'fog/core/model'

module Fog
  module Compute
    class OpenNebula
      class Network < Fog::Model

        identity :id
        attribute :name
        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

Version data entries

12 entries across 12 versions & 3 rubygems

Version Path
nsidc-fog-1.24.1 lib/fog/opennebula/models/compute/network.rb
fog-1.24.0 lib/fog/opennebula/models/compute/network.rb
ns-fog-1.22.11 lib/fog/opennebula/models/compute/network.rb
ns-fog-1.22.10 lib/fog/opennebula/models/compute/network.rb
ns-fog-1.22.9 lib/fog/opennebula/models/compute/network.rb
ns-fog-1.22.8 lib/fog/opennebula/models/compute/network.rb
ns-fog-1.22.7 lib/fog/opennebula/models/compute/network.rb
ns-fog-1.22.6 lib/fog/opennebula/models/compute/network.rb
fog-1.23.0 lib/fog/opennebula/models/compute/network.rb
ns-fog-1.22.4 lib/fog/opennebula/models/compute/network.rb
ns-fog-1.22.3 lib/fog/opennebula/models/compute/network.rb
ns-fog-1.22.2 lib/fog/opennebula/models/compute/network.rb