Sha256: e4be794f882efc5c7da125b9777b0efe562ae815931f364e782e80394cff2441

Contents?: true

Size: 1.5 KB

Versions: 11

Compression:

Stored size: 1.5 KB

Contents

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

      def compute_attributes
        [
          ['cpus',   _('Number of CPUs'), { bold: true }],
          ['memory', _('String, amount of memory, value in bytes'), { bold: true }],
          ['cpu_mode', _('Possible values: %{modes}') % { modes: 'default, host-model, host-passthrough' }]
        ]
      end

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

      def interface_attributes
        [
          ['compute_type',   _('Possible values: %s') % 'bridge, network'],
          ['compute_bridge', _('Name of interface according to type')],
          ['compute_model',  _('Possible values: %s') % 'virtio, rtl8139, ne2k_pci, pcnet, e1000'],
          ['compute_network'], _('Libvirt instance network, e.g. default')
        ]
      end

      def volume_attributes
        [
          ['pool_name',   _('One of available storage pools'), { bold: true }],
          ['capacity',    _('String value, e.g. 10G'), { bold: true }],
          ['allocation'], _('Initial allocation, e.g. 0G'),
          ['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

11 entries across 11 versions & 1 rubygems

Version Path
hammer_cli_foreman-2.0.2 lib/hammer_cli_foreman/compute_resource/libvirt.rb
hammer_cli_foreman-2.0.1 lib/hammer_cli_foreman/compute_resource/libvirt.rb
hammer_cli_foreman-2.0.0 lib/hammer_cli_foreman/compute_resource/libvirt.rb
hammer_cli_foreman-0.19.7 lib/hammer_cli_foreman/compute_resource/libvirt.rb
hammer_cli_foreman-0.19.6 lib/hammer_cli_foreman/compute_resource/libvirt.rb
hammer_cli_foreman-0.19.5 lib/hammer_cli_foreman/compute_resource/libvirt.rb
hammer_cli_foreman-0.19.4 lib/hammer_cli_foreman/compute_resource/libvirt.rb
hammer_cli_foreman-0.19.3 lib/hammer_cli_foreman/compute_resource/libvirt.rb
hammer_cli_foreman-0.19.2 lib/hammer_cli_foreman/compute_resource/libvirt.rb
hammer_cli_foreman-0.19.1 lib/hammer_cli_foreman/compute_resource/libvirt.rb
hammer_cli_foreman-0.19.0 lib/hammer_cli_foreman/compute_resource/libvirt.rb