Class: OvirtSDK4::InstanceTypesService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary collapse
-
#add(instance_type, opts = {}) ⇒ InstanceType
Creates a new instance type.
-
#instance_type_service(id) ⇒ InstanceTypeService
Locates the
instance_type
service. -
#list(opts = {}) ⇒ Array<InstanceType>
Lists all existing instance types in the system.
-
#service(path) ⇒ Service
Locates the service corresponding to the given path.
Methods inherited from Service
Instance Method Details
#add(instance_type, opts = {}) ⇒ InstanceType
Creates a new instance type.
This requires only a name attribute and can include all hardware configurations of the virtual machine.
POST /ovirt-engine/api/instancetypes
With a request body like this:
<instance_type>
<name>myinstancetype</name>
</template>
Creating an instance type with all hardware configurations with a request body like this:
<instance_type>
<name>myinstancetype</name>
<console>
<enabled>true</enabled>
</console>
<cpu>
<topology>
<cores>2</cores>
<sockets>2</sockets>
<threads>1</threads>
</topology>
</cpu>
<custom_cpu_model>AMD Opteron_G2</custom_cpu_model>
<custom_emulated_machine>q35</custom_emulated_machine>
<display>
<monitors>1</monitors>
<single_qxl_pci>true</single_qxl_pci>
<smartcard_enabled>true</smartcard_enabled>
<type>spice</type>
</display>
<high_availability>
<enabled>true</enabled>
<priority>1</priority>
</high_availability>
<io>
<threads>2</threads>
</io>
<memory>4294967296</memory>
<memory_policy>
<ballooning>true</ballooning>
<guaranteed>268435456</guaranteed>
</memory_policy>
<migration>
<auto_converge>inherit</auto_converge>
<compressed>inherit</compressed>
<policy id="00000000-0000-0000-0000-000000000000"/>
</migration>
<migration_downtime>2</migration_downtime>
<os>
<boot>
<devices>
<device>hd</device>
</devices>
</boot>
</os>
<rng_device>
<rate>
<bytes>200</bytes>
<period>2</period>
</rate>
<source>urandom</source>
</rng_device>
<soundcard_enabled>true</soundcard_enabled>
<usb>
<enabled>true</enabled>
<type>native</type>
</usb>
<virtio_scsi>
<enabled>true</enabled>
</virtio_scsi>
</instance_type>
14584 14585 14586 |
# File 'lib/ovirtsdk4/services.rb', line 14584 def add(instance_type, opts = {}) internal_add(instance_type, InstanceType, ADD, opts) end |
#instance_type_service(id) ⇒ InstanceTypeService
Locates the instance_type
service.
14638 14639 14640 |
# File 'lib/ovirtsdk4/services.rb', line 14638 def instance_type_service(id) InstanceTypeService.new(self, id) end |
#list(opts = {}) ⇒ Array<InstanceType>
Lists all existing instance types in the system.
The order of the returned list of instance types isn’t guaranteed.
14627 14628 14629 |
# File 'lib/ovirtsdk4/services.rb', line 14627 def list(opts = {}) internal_get(LIST, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
14649 14650 14651 14652 14653 14654 14655 14656 14657 14658 |
# File 'lib/ovirtsdk4/services.rb', line 14649 def service(path) if path.nil? || path == '' return self end index = path.index('/') if index.nil? return instance_type_service(path) end return instance_type_service(path[0..(index - 1)]).service(path[(index + 1)..-1]) end |