Sha256: 7bed7639c0e90fb46e291f21d646f9d1d9f4dc9c083be520cdab1202a20560c6

Contents?: true

Size: 972 Bytes

Versions: 6

Compression:

Stored size: 972 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 stop
        shutdown
      end

      def ready?
        running?
      end

      def mac
        vifs.first.mac
      end

      def state
        power_state
      end

      def vm_description
        format(_('%{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

6 entries across 6 versions & 1 rubygems

Version Path
foreman_xen-0.7.1 app/models/concerns/fog_extensions/xenserver/server.rb
foreman_xen-0.7.0 app/models/concerns/fog_extensions/xenserver/server.rb
foreman_xen-0.5.4 app/models/concerns/fog_extensions/xenserver/server.rb
foreman_xen-0.6.1 app/models/concerns/fog_extensions/xenserver/server.rb
foreman_xen-0.6.0 app/models/concerns/fog_extensions/xenserver/server.rb
foreman_xen-0.5.3 app/models/concerns/fog_extensions/xenserver/server.rb