class OvirtSDK4::ClustersService
Constants
- ADD
- LIST
Public Instance Methods
Creates a new cluster.
This requires the `name`, `cpu.type`, and `data_center` attributes. Identify the data center with either the `id` or `name` attribute.
- source
POST /ovirt-engine/api/clusters
With a request body like this:
- source,xml
<cluster>
<name>mycluster</name> <cpu> <type>Intel Nehalem Family</type> </cpu> <data_center id="123"/>
</cluster>
To create a cluster with an external network provider to be deployed on every host that is added to the cluster, send a request like this:
- source
POST /ovirt-engine/api/clusters
With a request body containing a reference to the desired provider:
- source,xml
<cluster>
<name>mycluster</name> <cpu> <type>Intel Nehalem Family</type> </cpu> <data_center id="123"/> <external_network_providers> <external_provider name="ovirt-provider-ovn"/> </external_network_providers>
</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 5964 def add(cluster, opts = {}) internal_add(cluster, Cluster, ADD, opts) end
A 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 6021 def cluster_service(id) ClusterService.new(self, id) end
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 should be performed taking case into account.
The default value is `true`, which means that case is taken into account. 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 [String] :follow Indicates which inner links should be followed. The objects referenced by these links will be fetched as part
of the current request. See <<documents/003_common_concepts/follow, here>> for details.
@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 6010 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 6032 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