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 Penryn 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 Penryn Family</type>
</cpu>
<data_center id="123"/>
<external_network_providers>
<external_provider name="ovirt-provider-ovn"/>
</external_network_providers>
</cluster>
5250 5251 5252 |
# File 'lib/ovirtsdk4/services.rb', line 5250 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.
5307 5308 5309 |
# File 'lib/ovirtsdk4/services.rb', line 5307 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.
5296 5297 5298 |
# File 'lib/ovirtsdk4/services.rb', line 5296 def list(opts = {}) internal_get(LIST, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 |
# File 'lib/ovirtsdk4/services.rb', line 5318 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 |