Class: OvirtSDK4::SystemOptionService

Inherits:
Service
  • Object
show all
Defined in:
lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb

Instance Method Summary collapse

Methods inherited from Service

#inspect, #to_s

Instance Method Details

#get(opts = {}) ⇒ SystemOption

Get the values of specific configuration option.

For example to retrieve the values of configuration option MigrationPolicies send a request like this:

GET /ovirt-engine/api/options/MigrationPolicies HTTP/1.1

The response to that request will be the following:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<system_option href="/ovirt-engine/api/options/MigrationPolicies" id="MigrationPolicies">
    <name>MigrationPolicies</name>
    <values>
        <system_option_value>
            <value>[{"id":{"uuid":"80554327-0569-496b-bdeb-fcbbf52b827b"},...}]</value>
            <version>4.2</version>
        </system_option_value>
        <system_option_value>
            <value>[{"id":{"uuid":"80554327-0569-496b-bdeb-fcbbf52b827b"},...}]</value>
            <version>4.3</version>
        </system_option_value>
        <system_option_value>
            <value>[{"id":{"uuid":"80554327-0569-496b-bdeb-fcbbf52b827b"},...}]</value>
            <version>4.4</version>
        </system_option_value>
        <system_option_value>
            <value>[{"id":{"uuid":"80554327-0569-496b-bdeb-fcbbf52b827b"},...}]</value>
            <version>4.5</version>
        </system_option_value>
        <system_option_value>
            <value>[{"id":{"uuid":"80554327-0569-496b-bdeb-fcbbf52b827b"},...}]</value>
            <version>4.6</version>
        </system_option_value>
        <system_option_value>
            <value>[{"id":{"uuid":"80554327-0569-496b-bdeb-fcbbf52b827b"},...}]</value>
            <version>4.7</version>
        </system_option_value>
    </values>
</system_option>
Note
The appropriate permissions are required to query configuration options. Some options can be queried only by users with administrator permissions.
Important

There is NO backward compatibility and no guarantee about the names or values of the options. Options may be removed and their meaning can be changed at any point.

We strongly discourage the use of this service for applications other than the ones that are released simultaneously with the engine. Usage by other applications is not supported. Therefore there will be no documentation listing accessible configuration options.

Parameters:

  • opts (Hash) (defaults to: {})

    Additional options.

Options Hash (opts):

  • :version (String)

    Optional version parameter that specifies that only particular version of the configuration option should be returned. If this parameter isn’t used then all the versions will be returned.

    For example, to get the value of the MigrationPolicies option but only for version 4.2 send a request like this:

    GET /ovirt-engine/api/options/MigrationPolicies?version=4.2 HTTP/1.1

    The response to that request will be like this:

    <system_option href="/ovirt-engine/api/options/MigrationPolicies" id="MigrationPolicies">
        <name>MigrationPolicies</name>
        <values>
            <system_option_value>
                <value>[{"id":{"uuid":"80554327-0569-496b-bdeb-fcbbf52b827b"},...}]</value>
                <version>4.2</version>
            </system_option_value>
        </values>
    </system_option>
  • :headers (Hash) — default: {}

    Additional HTTP headers.

  • :query (Hash) — default: {}

    Additional URL query parameters.

  • :timeout (Integer) — default: nil

    The timeout for this request, in seconds. If no value is explicitly given then the timeout set globally for the connection will be used.

  • :wait (Boolean) — default: true

    If true wait for the response.

Returns:



25956
25957
25958
# File 'lib/ovirtsdk4/services.rb', line 25956

def get(opts = {})
  internal_get(GET, opts)
end

#service(path) ⇒ Service

Locates the service corresponding to the given path.

Parameters:

  • path (String)

    The path of the service.

Returns:

  • (Service)

    A reference to the service.

Raises:



25967
25968
25969
25970
25971
25972
# File 'lib/ovirtsdk4/services.rb', line 25967

def service(path)
  if path.nil? || path == ''
    return self
  end
  raise Error.new("The path \"#{path}\" doesn't correspond to any service")
end