Sha256: 4646f42d42dd8495e15683094328dc89bea7fc3c7f59df6a2b962962e0587737

Contents?: true

Size: 936 Bytes

Versions: 8

Compression:

Stored size: 936 Bytes

Contents

module FogExtensions
  module Xenserver
    module Server
      extend ActiveSupport::Concern

      include ActionView::Helpers::NumberHelper

      attr_accessor :start
      attr_accessor :memory_min, :memory_max, :custom_template_name, :builtin_template_name, :hypervisor_host

      def to_s
        name
      end

      def nics_attributes=(attrs)
      end

      def volumes_attributes=(attrs)
      end

      def memory
        memory_static_max.to_i
      end

      def reset
        reboot
      end

      def ready?
        running?
      end

      def mac
        vifs.first.mac
      end

      def state
        power_state
      end

      def vm_description
        _('%{cpus} CPUs and %{ram} memory') % { :cpus => vcpus_max, :ram => number_to_human_size(memory_max.to_i) }
      end

      def interfaces
        vifs
      end

      def select_nic(fog_nics, nic)
        fog_nics[0]
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
foreman_xen-0.3.1 app/models/concerns/fog_extensions/xenserver/server.rb
foreman_xen-0.3.0 app/models/concerns/fog_extensions/xenserver/server.rb
foreman_xen-0.2.4 app/models/concerns/fog_extensions/xenserver/server.rb
foreman_xen-0.1.8 app/models/concerns/fog_extensions/xenserver/server.rb
foreman_xen-0.1.7 app/models/concerns/fog_extensions/xenserver/server.rb
foreman_xen-0.2.3 app/models/concerns/fog_extensions/xenserver/server.rb
foreman_xen-0.2.2 app/models/concerns/fog_extensions/xenserver/server.rb
foreman_xen-0.1.6 app/models/concerns/fog_extensions/xenserver/server.rb