Class: OvirtSDK4::ClustersService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary collapse
-
#add(cluster, opts = {}) ⇒ Cluster
Creates a new cluster.
-
#cluster_service(id) ⇒ ClusterService
A reference to the service that manages a specific cluster.
-
#list(opts = {}) ⇒ Array<Cluster>
Returns the list of clusters of the system.
-
#service(path) ⇒ Service
Locates the service corresponding to the given path.
Methods inherited from Service
Instance Method Details
#add(cluster, opts = {}) ⇒ Cluster
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.
POST /ovirt-engine/api/clusters
With a request body like this:
<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:
POST /ovirt-engine/api/clusters
With a request body containing a reference to the desired provider:
<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>
5964 5965 5966 |
# File 'lib/ovirtsdk4/services.rb', line 5964 def add(cluster, opts = {}) internal_add(cluster, Cluster, ADD, opts) end |
#cluster_service(id) ⇒ ClusterService
A reference to the service that manages a specific cluster.
6021 6022 6023 |
# File 'lib/ovirtsdk4/services.rb', line 6021 def cluster_service(id) ClusterService.new(self, id) end |
#list(opts = {}) ⇒ Array<Cluster>
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.
6010 6011 6012 |
# File 'lib/ovirtsdk4/services.rb', line 6010 def list(opts = {}) internal_get(LIST, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 |
# 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 |