Sha256: d830a8ab8ebe43158181098a97b334ef509eeb2c1379504bd3a4820abf0be2b3

Contents?: true

Size: 969 Bytes

Versions: 5

Compression:

Stored size: 969 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
        _('%{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

5 entries across 5 versions & 1 rubygems

Version Path
foreman_xen-0.5.2 app/models/concerns/fog_extensions/xenserver/server.rb
foreman_xen-0.5.1 app/models/concerns/fog_extensions/xenserver/server.rb
foreman_xen-0.5.0 app/models/concerns/fog_extensions/xenserver/server.rb
foreman_xen-0.3.2 app/models/concerns/fog_extensions/xenserver/server.rb
foreman_xen-0.4.1 app/models/concerns/fog_extensions/xenserver/server.rb