class OvirtSDK4::ClustersService

Constants

ADD
LIST

Public Instance Methods

add(cluster, opts = {}) click to toggle source

Creates a new cluster.

This requires the `name`, `cpu.type` and `data_center` attributes. Identify the data center with either the `id` or `name` attributes.

source

POST /ovirt-engine/api/clusters


With a request body like this:

source,xml

<cluster>

<name>mycluster</name>
<cpu>
  <type>Intel Penryn Family</type>
</cpu>
<data_center id="123"/>

</cluster>


@param cluster [Cluster] The `cluster` to add.

@param opts [Hash] Additional options.

@option opts [Hash] :headers ({}) Additional HTTP headers.

@option opts [Hash] :query ({}) Additional URL query parameters.

@option opts [Integer] :timeout (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.

@option opts [Boolean] :wait (true) If `true` wait for the response.

@return [Cluster]

# File lib/ovirtsdk4/services.rb, line 5244
def add(cluster, opts = {})
  internal_add(cluster, Cluster, ADD, opts)
end
cluster_service(id) click to toggle source

Reference to the service that manages a specific cluster.

@param id [String] The identifier of the `cluster`.

@return [ClusterService] A reference to the `cluster` service.

# File lib/ovirtsdk4/services.rb, line 5297
def cluster_service(id)
  ClusterService.new(self, id)
end
list(opts = {}) click to toggle source

Returns the list of clusters of the system.

The order of the returned clusters is guaranteed only if the `sortby` clause is included in the `search` parameter.

@param opts [Hash] Additional options.

@option opts [Boolean] :case_sensitive Indicates if the search performed using the `search` parameter should be performed taking case into

account. The default value is `true`, which means that case is taken into account. If you want to search
ignoring case set it to `false`.

@option opts [Boolean] :filter Indicates if the results should be filtered according to the permissions of the user.

@option opts [Integer] :max Sets the maximum number of clusters to return. If not specified all the clusters are returned.

@option opts [String] :search A query string used to restrict the returned clusters.

@option opts [Hash] :headers ({}) Additional HTTP headers.

@option opts [Hash] :query ({}) Additional URL query parameters.

@option opts [Integer] :timeout (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.

@option opts [Boolean] :wait (true) If `true` wait for the response.

@return [Array<Cluster>]

# File lib/ovirtsdk4/services.rb, line 5286
def list(opts = {})
  internal_get(LIST, opts)
end
service(path) click to toggle source

Locates the service corresponding to the given path.

@param path [String] The path of the service.

@return [Service] A reference to the service.

# File lib/ovirtsdk4/services.rb, line 5308
def service(path)
  if path.nil? || path == ''
    return self
  end
  index = path.index('/')
  if index.nil?
    return cluster_service(path)
  end
  return cluster_service(path[0..(index - 1)]).service(path[(index +1)..-1])
end
to_s() click to toggle source

Returns an string representation of this service.

@return [String]

# File lib/ovirtsdk4/services.rb, line 5324
def to_s
  "#<#{ClustersService}:#{absolute_path}>"
end