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 MigrationPoliciesSupported send a request like this:

GET /ovirt-engine/api/options/MigrationPoliciesSupported

The response to that request will be the following:

<system_option href="/ovirt-engine/api/options/MigrationPoliciesSupported" id="MigrationPoliciesSupported">
  <name>MigrationPoliciesSupported</name>
  <values>
    <system_option_value>
      <value>true</value>
      <version>4.0</version>
    </system_option_value>
    <system_option_value>
      <value>true</value>
      <version>4.1</version>
    </system_option_value>
    <system_option_value>
      <value>true</value>
      <version>4.2</version>
    </system_option_value>
    <system_option_value>
      <value>false</value>
      <version>3.6</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 MigrationPoliciesSupported option but only for version 4.2 send a request like this:

    GET /ovirt-engine/api/options/MigrationPoliciesSupported?version=4.2

    The response to that request will be like this:

    <system_option href="/ovirt-engine/api/options/MigrationPoliciesSupported" id="MigrationPoliciesSupported">
      <name>MigrationPoliciesSupported</name>
      <values>
        <system_option_value>
          <value>true</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:



24858
24859
24860
# File 'lib/ovirtsdk4/services.rb', line 24858

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:



24869
24870
24871
24872
24873
24874
# File 'lib/ovirtsdk4/services.rb', line 24869

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