Class: ForemanAP::BuildSpec

Inherits:
Object
  • Object
show all
Defined in:
lib/foreman_vm/buildspec.rb

Overview

A build specification

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#cpusObject

Number of CPUs



10
11
12
# File 'lib/foreman_vm/buildspec.rb', line 10

def cpus
  @cpus
end

#disk_capacityObject

Amount of disk space. Multiple disks can be separated with a comma.



14
15
16
# File 'lib/foreman_vm/buildspec.rb', line 14

def disk_capacity
  @disk_capacity
end

#disk_formatObject

The disk format; either raw or qcow2



16
17
18
# File 'lib/foreman_vm/buildspec.rb', line 16

def disk_format
  @disk_format
end

#domainObject

DNS domain name



8
9
10
# File 'lib/foreman_vm/buildspec.rb', line 8

def domain
  @domain
end

#memoryObject

Amount of memory



12
13
14
# File 'lib/foreman_vm/buildspec.rb', line 12

def memory
  @memory
end

#nameObject

Short hostname



6
7
8
# File 'lib/foreman_vm/buildspec.rb', line 6

def name
  @name
end

#network_interfaceObject

Network interface



20
21
22
# File 'lib/foreman_vm/buildspec.rb', line 20

def network_interface
  @network_interface
end

#storage_poolObject

The libvirt storage pool



18
19
20
# File 'lib/foreman_vm/buildspec.rb', line 18

def storage_pool
  @storage_pool
end

Instance Method Details

#to_foreman_apiObject

Generate output suitable for feeding into the Foreman API



23
24
25
26
27
28
# File 'lib/foreman_vm/buildspec.rb', line 23

def to_foreman_api
  rec = {}
  rec['compute_attributes'] = {}
  rec['compute_attributes']['volumes_attributes'] = disk_capacity_to_api
  rec
end