Chapter 3. Ruby Examples
3.1. Connecting to the Red Hat Virtualization Manager
The Connection class is the entry point of the software development kit. It provides access to the services of the Red Hat Virtualization Manager’s REST API.
The parameters of the Connection class are:
-
url- Base URL of the Red Hat Virtualization Manager API -
username -
password -
ca_file- PEM file containing the trusted CA certificates. Theca.pemfile is required when connecting to a server protected by TLS. If you do not specify theca_file, the system-wide CA certificate store is used.
Connecting to the Red Hat Virtualization Manager
connection = OvirtSDK4::Connection.new( url: 'https://engine.example.com/ovirt-engine/api', username: 'admin@internal', password: '...', ca_file: 'ca.pem', )
The connection holds critical resources, including a pool of HTTP connections to the server and an authentication token. You must free these resources when they are no longer in use:
connection.close
The connection, and all the services obtained from it, cannot be used after the connection has been closed.
If the connection fails, the software development kit will raise an Error exception, containing details of the failure.
For more information, see http://www.rubydoc.info/gems/ovirt-engine-sdk/OvirtSDK4/Connection:initialize.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.