Class: OvirtSDK4::QossService

Inherits:
Service
  • Object
show all
Defined in:
lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb

Instance Method Summary collapse

Methods inherited from Service

#inspect, #to_s

Instance Method Details

#add(qos, opts = {}) ⇒ Qos

Add a new QoS to the dataCenter.

POST /ovirt-engine/api/datacenters/123/qoss

The response will look as follows:

<qos href="/ovirt-engine/api/datacenters/123/qoss/123" id="123">
  <name>123</name>
  <description>123</description>
  <max_iops>10</max_iops>
  <type>storage</type>
  <data_center href="/ovirt-engine/api/datacenters/123" id="123"/>
</qos>

Parameters:

  • qos (Qos)

    Added QoS object.

  • opts (Hash) (defaults to: {})

    Additional options.

Options Hash (opts):

  • :headers (Hash) — default: {}

    Additional HTTP headers.

  • :query (Hash) — default: {}

    Additional URL query parameters.

  • :timeout (Integer) — default: 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.

  • :wait (Boolean) — default: true

    If true wait for the response.

Returns:



19363
19364
19365
# File 'lib/ovirtsdk4/services.rb', line 19363

def add(qos, opts = {})
  internal_add(qos, Qos, ADD, opts)
end

#list(opts = {}) ⇒ Array<Qos>

Returns the list of quality of service configurations available in the data center.

GET /ovirt-engine/api/datacenter/123/qoss

You will get response which will look like this:

<qoss>
  <qos href="/ovirt-engine/api/datacenters/123/qoss/1" id="1">...</qos>
  <qos href="/ovirt-engine/api/datacenters/123/qoss/2" id="2">...</qos>
  <qos href="/ovirt-engine/api/datacenters/123/qoss/3" id="3">...</qos>
</qoss>

The returned list of quality of service configurations isn’t guaranteed.

Parameters:

  • opts (Hash) (defaults to: {})

    Additional options.

Options Hash (opts):

  • :follow (String)

    Indicates which inner links should be followed. The objects referenced by these links will be fetched as part of the current request. See here for details.

  • :max (Integer)

    Sets the maximum number of QoS descriptors to return. If not specified all the descriptors are returned.

  • :headers (Hash) — default: {}

    Additional HTTP headers.

  • :query (Hash) — default: {}

    Additional URL query parameters.

  • :timeout (Integer) — default: 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.

  • :wait (Boolean) — default: true

    If true wait for the response.

Returns:



19413
19414
19415
# File 'lib/ovirtsdk4/services.rb', line 19413

def list(opts = {})
  internal_get(LIST, opts)
end

#qos_service(id) ⇒ QosService

A reference to a service managing a specific QoS.

Parameters:

  • id (String)

    The identifier of the qos.

Returns:

  • (QosService)

    A reference to the qos service.



19424
19425
19426
# File 'lib/ovirtsdk4/services.rb', line 19424

def qos_service(id)
  QosService.new(self, id)
end

#service(path) ⇒ Service

Locates the service corresponding to the given path.

Parameters:

  • path (String)

    The path of the service.

Returns:

  • (Service)

    A reference to the service.



19435
19436
19437
19438
19439
19440
19441
19442
19443
19444
# File 'lib/ovirtsdk4/services.rb', line 19435

def service(path)
  if path.nil? || path == ''
    return self
  end
  index = path.index('/')
  if index.nil?
    return qos_service(path)
  end
  return qos_service(path[0..(index - 1)]).service(path[(index + 1)..-1])
end