Class: OvirtSDK4::ClusterLevelService

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

#cluster_features_serviceClusterFeaturesService

Reference to the service that manages the collection of supported features for this cluster level.

Returns:



5583
5584
5585
# File 'lib/ovirtsdk4/services.rb', line 5583

def cluster_features_service
  @cluster_features_service ||= ClusterFeaturesService.new(self, 'clusterfeatures')
end

#get(opts = {}) ⇒ ClusterLevel

Provides the information about the capabilities of the specific cluster level managed by this service.

For example, to find what CPU types are supported by level 3.6 you can send a request like this:

GET /ovirt-engine/api/clusterlevels/3.6

That will return a ClusterLevel object containing the supported CPU types, and other information which describes the cluster level:

<cluster_level id="3.6">
  <cpu_types>
    <cpu_type>
      <name>Intel Nehalem Family</name>
      <level>3</level>
      <architecture>x86_64</architecture>
    </cpu_type>
    ...
  </cpu_types>
  <permits>
    <permit id="1">
      <name>create_vm</name>
      <administrative>false</administrative>
    </permit>
    ...
  </permits>
</cluster_level>

Parameters:

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

    Additional options.

Options Hash (opts):

  • :follow (String)

    Indicates which inner links should be followed. The objects referenced by these links will be fetched as part of the current request. See here for details.

  • :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:



5574
5575
5576
# File 'lib/ovirtsdk4/services.rb', line 5574

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:



5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
# File 'lib/ovirtsdk4/services.rb', line 5594

def service(path)
  if path.nil? || path == ''
    return self
  end
  if path == 'clusterfeatures'
    return cluster_features_service
  end
  if path.start_with?('clusterfeatures/')
    return cluster_features_service.service(path[16..-1])
  end
  raise Error.new("The path \"#{path}\" doesn't correspond to any service")
end