Class VmsServiceImpl
- java.lang.Object
-
- org.ovirt.engine.sdk4.internal.services.ServiceImpl
-
- org.ovirt.engine.sdk4.internal.services.VmsServiceImpl
-
- All Implemented Interfaces:
Service
,VmsService
public class VmsServiceImpl extends ServiceImpl implements VmsService
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.ovirt.engine.sdk4.services.VmsService
VmsService.AddFromConfigurationRequest, VmsService.AddFromConfigurationResponse, VmsService.AddFromScratchRequest, VmsService.AddFromScratchResponse, VmsService.AddFromSnapshotRequest, VmsService.AddFromSnapshotResponse, VmsService.AddRequest, VmsService.AddResponse, VmsService.ListRequest, VmsService.ListResponse
-
-
Constructor Summary
Constructors Constructor Description VmsServiceImpl(HttpConnection connection, String path)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description VmsService.AddRequest
add()
Creates a new virtual machine.VmsService.AddFromConfigurationRequest
addFromConfiguration()
add a virtual machine to the system from a configuration - requires the configuration type and the configuration dataVmsService.AddFromScratchRequest
addFromScratch()
add a virtual machine to the system from scratchVmsService.AddFromSnapshotRequest
addFromSnapshot()
add a virtual machine to the system by cloning from a snapshotVmsService.ListRequest
list()
Returns the list of virtual machines of the system.Service
service(String path)
Service locator method, returns individual service on which the URI is dispatched.String
toString()
VmService
vmService(String id)
-
Methods inherited from class org.ovirt.engine.sdk4.internal.services.ServiceImpl
checkAction, checkFault, getConnection, getPath, throwError
-
-
-
-
Constructor Detail
-
VmsServiceImpl
public VmsServiceImpl(HttpConnection connection, String path)
-
-
Method Detail
-
add
public VmsService.AddRequest add()
Description copied from interface:VmsService
Creates a new virtual machine. The virtual machine can be created in different ways: - From a template. In this case the identifier or name of the template must be provided. For example, using a plain shell script and XML: [source,bash] ---- #!/bin/sh -ex url="https://engine.example.com/ovirt-engine/api" user="admin@internal" password="..." curl \ --verbose \ --cacert /etc/pki/ovirt-engine/ca.pem \ --user "${user}:${password}" \ --request POST \ --header "Version: 4" \ --header "Content-Type: application/xml" \ --header "Accept: application/xml" \ --data 'myvm Blank mycluster myvm mycluster ... ---- When the virtual machine is created from a snapshot this set of disks is slightly different, it uses the `image_id` attribute instead of `id`. [source,xml] ----... ---- It is possible to specify additional virtual machine parameters in the XML description, e.g. a virtual machine of `desktop` type, with 2 GiB of RAM and additional description can be added sending a request body like the following: [source,xml] ----8d4bd566-6c86-4592-a4a7-912dbf93c298 myvm My Desktop Virtual Machine desktop 2147483648 ...... ---- In order to boot from CDROM, you first need to insert a disk, as described in the <>. Then booting from that CDROM can be specified using the `os.boot.devices` attribute: [source,xml] ---- ... ---- In all cases the name or identifier of the cluster where the virtual machine will be created is mandatory.cdrom - Specified by:
add
in interfaceVmsService
-
addFromConfiguration
public VmsService.AddFromConfigurationRequest addFromConfiguration()
Description copied from interface:VmsService
add a virtual machine to the system from a configuration - requires the configuration type and the configuration data- Specified by:
addFromConfiguration
in interfaceVmsService
-
addFromScratch
public VmsService.AddFromScratchRequest addFromScratch()
Description copied from interface:VmsService
add a virtual machine to the system from scratch- Specified by:
addFromScratch
in interfaceVmsService
-
addFromSnapshot
public VmsService.AddFromSnapshotRequest addFromSnapshot()
Description copied from interface:VmsService
add a virtual machine to the system by cloning from a snapshot- Specified by:
addFromSnapshot
in interfaceVmsService
-
list
public VmsService.ListRequest list()
Description copied from interface:VmsService
Returns the list of virtual machines of the system. The order of the returned list of virtual machines is guaranteed only if the `sortby` clause is included in the `search` parameter.- Specified by:
list
in interfaceVmsService
-
vmService
public VmService vmService(String id)
- Specified by:
vmService
in interfaceVmsService
-
service
public Service service(String path)
Description copied from interface:VmsService
Service locator method, returns individual service on which the URI is dispatched.- Specified by:
service
in interfaceVmsService
-
-