Class: OvirtSDK4::HostStorageService

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

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

Get list of storages.

GET /ovirt-engine/api/hosts/123/storage HTTP/1.1

The XML response you get will be like this one:

<host_storages>
  <host_storage id="123">
    ...
  </host_storage>
  ...
</host_storages>

The order of the returned list of storages isn’t guaranteed.

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.

  • :report_status (Boolean)

    Indicates if the status of the LUNs in the storage should be checked. Checking the status of the LUN is an heavy weight operation and this data is not always needed by the user. This parameter will give the option to not perform the status check of the LUNs.

    The default is true for backward compatibility.

    Here an example with the LUN status :

    <host_storage id="123">
      <logical_units>
        <logical_unit id="123">
          <lun_mapping>0</lun_mapping>
          <paths>1</paths>
          <product_id>lun0</product_id>
          <serial>123</serial>
          <size>10737418240</size>
          <status>used</status>
          <vendor_id>LIO-ORG</vendor_id>
          <volume_group_id>123</volume_group_id>
        </logical_unit>
      </logical_units>
      <type>iscsi</type>
      <host id="123"/>
    </host_storage>

    Here an example without the LUN status :

    <host_storage id="123">
      <logical_units>
        <logical_unit id="123">
          <lun_mapping>0</lun_mapping>
          <paths>1</paths>
          <product_id>lun0</product_id>
          <serial>123</serial>
          <size>10737418240</size>
          <vendor_id>LIO-ORG</vendor_id>
          <volume_group_id>123</volume_group_id>
        </logical_unit>
      </logical_units>
      <type>iscsi</type>
      <host id="123"/>
    </host_storage>
  • :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.



12467
12468
12469
# File 'lib/ovirtsdk4/services.rb', line 12467

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

#service(path) ⇒ Service

Locates the service corresponding to the given path.



12489
12490
12491
12492
12493
12494
12495
12496
12497
12498
# File 'lib/ovirtsdk4/services.rb', line 12489

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

#storage_service(id) ⇒ StorageService

Reference to a service managing the storage.



12478
12479
12480
# File 'lib/ovirtsdk4/services.rb', line 12478

def storage_service(id)
  StorageService.new(self, id)
end