Sha256: 421dbbd804c659b29dca5a3f3cc6e74eb45eb4b7f2a3baa534cd8f3000b47103

Contents?: true

Size: 1.17 KB

Versions: 3

Compression:

Stored size: 1.17 KB

Contents

module HammerCLIForeman
  module ComputeResources
    class Libvirt < Base
      def name
        'Libvirt'
      end

      def compute_attributes
        [
          ['cpus',   _('Number of CPUs')],
          ['memory', _('String, amount of memory, value in bytes')]
        ]
      end

      def host_attributes
        [
          ['start',  _('Boolean (expressed as 0 or 1), whether to start the machine or not')]
        ]
      end

      def interface_attributes
        [
          ['type',   _('Possible values: %s') % 'bridge, network'],
          ['bridge', _('Name of interface according to type')],
          ['model',  _('Possible values: %s') % 'virtio, rtl8139, ne2k_pci, pcnet, e1000']
        ]
      end

      def volume_attributes
        [
          ['pool_name',   _('One of available storage pools')],
          ['capacity',    _('String value, eg. 10G')],
          ['format_type', _('Possible values: %s') % 'raw, qcow2']
        ]
      end

      def interfaces_attrs_name
        'nics_attributes'
      end

      def mandatory_resource_options
        super + %i[url]
      end
    end

    HammerCLIForeman.register_compute_resource('libvirt', Libvirt.new)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
hammer_cli_foreman-0.18.2 lib/hammer_cli_foreman/compute_resource/libvirt.rb
hammer_cli_foreman-0.18.1 lib/hammer_cli_foreman/compute_resource/libvirt.rb
hammer_cli_foreman-0.18.0 lib/hammer_cli_foreman/compute_resource/libvirt.rb