Class: ForemanAP::BuildSpec
- Inherits:
-
Object
- Object
- ForemanAP::BuildSpec
- Defined in:
- lib/foreman_vm/buildspec.rb
Overview
A build specification
Instance Attribute Summary collapse
-
#cpus ⇒ Object
Number of CPUs.
-
#disk_capacity ⇒ Object
Amount of disk space.
-
#disk_format ⇒ Object
The disk format; either raw or qcow2.
-
#domain ⇒ Object
DNS domain name.
-
#memory ⇒ Object
Amount of memory.
-
#name ⇒ Object
Short hostname.
-
#network_interface ⇒ Object
Network interface.
-
#storage_pool ⇒ Object
The libvirt storage pool.
Instance Method Summary collapse
-
#to_foreman_api ⇒ Object
Generate output suitable for feeding into the Foreman API.
Instance Attribute Details
#cpus ⇒ Object
Number of CPUs
10 11 12 |
# File 'lib/foreman_vm/buildspec.rb', line 10 def cpus @cpus end |
#disk_capacity ⇒ Object
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_format ⇒ Object
The disk format; either raw or qcow2
16 17 18 |
# File 'lib/foreman_vm/buildspec.rb', line 16 def disk_format @disk_format end |
#domain ⇒ Object
DNS domain name
8 9 10 |
# File 'lib/foreman_vm/buildspec.rb', line 8 def domain @domain end |
#memory ⇒ Object
Amount of memory
12 13 14 |
# File 'lib/foreman_vm/buildspec.rb', line 12 def memory @memory end |
#name ⇒ Object
Short hostname
6 7 8 |
# File 'lib/foreman_vm/buildspec.rb', line 6 def name @name end |
#network_interface ⇒ Object
Network interface
20 21 22 |
# File 'lib/foreman_vm/buildspec.rb', line 20 def network_interface @network_interface end |
#storage_pool ⇒ Object
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_api ⇒ Object
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 |