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.
POST /ovirt-engine/api/clusters
With a request body like this:
<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 4408 def add(cluster, opts = {}) internal_add(cluster, Cluster, ADD, opts) end
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 4458 def cluster_service(id) ClusterService.new(@connection, "#{@path}/#{id}") end
Returns the representation of the object managed by this service.
@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 4447 def list(opts = {}) internal_get(LIST, opts) end
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 4469 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
Returns an string representation of this service.
@return [String]
# File lib/ovirtsdk4/services.rb, line 4485 def to_s "#<#{ClustersService}:#{@path}>" end