Class: HammerCLIForemanKubevirt::ComputeResources::Kubevirt

Inherits:
HammerCLIForeman::ComputeResources::Base
  • Object
show all
Defined in:
lib/hammer_cli_foreman_kubevirt/compute_resources/kubevirt.rb

Instance Method Summary collapse

Instance Method Details

#compute_attributesObject



12
13
14
15
16
17
# File 'lib/hammer_cli_foreman_kubevirt/compute_resources/kubevirt.rb', line 12

def compute_attributes
  [
    ['cpu_cores', _('number of cores, Integer value')],
    ['memory', _('Amount of memory, integer value in bytes')],
  ]
end

#host_attributesObject



19
20
21
22
23
# File 'lib/hammer_cli_foreman_kubevirt/compute_resources/kubevirt.rb', line 19

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

#interface_attributesObject



25
26
27
28
29
30
# File 'lib/hammer_cli_foreman_kubevirt/compute_resources/kubevirt.rb', line 25

def interface_attributes
  [
    ['compute_cni_provider', _('Container Network Interface Provider name')],
    ['compute_network', _('The network to connect the vm to')],
  ]
end

#mandatory_resource_optionsObject



48
49
50
# File 'lib/hammer_cli_foreman_kubevirt/compute_resources/kubevirt.rb', line 48

def mandatory_resource_options
  super + %i[hostname api_port namespace token]
end

#nameObject



8
9
10
# File 'lib/hammer_cli_foreman_kubevirt/compute_resources/kubevirt.rb', line 8

def name
  _('KubeVirt')
end

#provider_specific_fieldsObject



40
41
42
43
44
45
46
# File 'lib/hammer_cli_foreman_kubevirt/compute_resources/kubevirt.rb', line 40

def provider_specific_fields
  [
    Fields::Field.new(label: _('hostname'), path: [:hostname]),
    Fields::Field.new(label: _('api_port'), path: [:api_port]),
    Fields::Field.new(label: _('namespace'), path: [:namespace]),
  ]
end

#volume_attributesObject



32
33
34
35
36
37
38
# File 'lib/hammer_cli_foreman_kubevirt/compute_resources/kubevirt.rb', line 32

def volume_attributes
  [
    ['capacity', _('Volume size in GB, integer value')],
    ['storage_class', _('Name of the storage class')],
    ['bootable', _('Boolean, only one volume can be bootable (overrides network interface boot)')],
  ]
end