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 HTTP/1.1
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 HTTP/1.1
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>
5900 5901 5902 |
# File 'lib/ovirtsdk4/services.rb', line 5900 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.
5957 5958 5959 |
# File 'lib/ovirtsdk4/services.rb', line 5957 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.
5946 5947 5948 |
# File 'lib/ovirtsdk4/services.rb', line 5946 def list(opts = {}) internal_get(LIST, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
5968 5969 5970 5971 5972 5973 5974 5975 5976 5977 |
# File 'lib/ovirtsdk4/services.rb', line 5968 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 |