Class: OvirtSDK4::HostStorageService
- Inherits:
-
Service
- Object
- Service
- OvirtSDK4::HostStorageService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary (collapse)
-
- (Array<HostStorage>) list(opts = {})
Returns the representation of the object managed by this service.
-
- (Service) service(path)
Locates the service corresponding to the given path.
-
- (StorageService) storage_service(id)
Locates the
storage
service. -
- (String) to_s
Returns an string representation of this service.
Instance Method Details
- (Array<HostStorage>) list(opts = {})
Returns the representation of the object managed by this service.
10029 10030 10031 10032 10033 10034 10035 10036 10037 10038 10039 10040 10041 10042 10043 10044 10045 10046 10047 10048 10049 |
# File 'lib/ovirtsdk4/services.rb', line 10029 def list(opts = {}) query = {} value = opts[:report_status] unless value.nil? value = Writer.render_boolean(value) query['report_status'] = value end request = Request.new(:method => :GET, :path => @path, :query => query) response = @connection.send(request) case response.code when 200 begin reader = XmlReader.new(response.body) return HostStorageReader.read_many(reader) ensure reader.close end else check_fault(response) end end |
- (Service) service(path)
Locates the service corresponding to the given path.
10069 10070 10071 10072 10073 10074 10075 10076 10077 10078 |
# File 'lib/ovirtsdk4/services.rb', line 10069 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 |
- (StorageService) storage_service(id)
Locates the storage
service.
10058 10059 10060 |
# File 'lib/ovirtsdk4/services.rb', line 10058 def storage_service(id) return StorageService.new(@connection, "#{@path}/#{id}") end |
- (String) to_s
Returns an string representation of this service.
10085 10086 10087 |
# File 'lib/ovirtsdk4/services.rb', line 10085 def to_s return "#<#{HostStorageService}:#{@path}>" end |