Class: OvirtSDK4::StorageDomainContentDisksService
- Inherits:
-
Service
- Object
- Service
- OvirtSDK4::StorageDomainContentDisksService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary (collapse)
-
- (StorageDomainContentDiskService) disk_service(id)
Locates the
disk
service. -
- (Array<Disk>) list(opts = {})
Returns the representation of the object managed by this service.
-
- (Service) service(path)
Locates the service corresponding to the given path.
-
- (String) to_s
Returns an string representation of this service.
Instance Method Details
- (StorageDomainContentDiskService) disk_service(id)
Locates the disk
service.
19193 19194 19195 |
# File 'lib/ovirtsdk4/services.rb', line 19193 def disk_service(id) return StorageDomainContentDiskService.new(@connection, "#{@path}/#{id}") end |
- (Array<Disk>) list(opts = {})
Returns the representation of the object managed by this service.
19155 19156 19157 19158 19159 19160 19161 19162 19163 19164 19165 19166 19167 19168 19169 19170 19171 19172 19173 19174 19175 19176 19177 19178 19179 19180 19181 19182 19183 19184 |
# File 'lib/ovirtsdk4/services.rb', line 19155 def list(opts = {}) query = {} value = opts[:case_sensitive] unless value.nil? value = Writer.render_boolean(value) query['case_sensitive'] = value end value = opts[:max] unless value.nil? value = Writer.render_integer(value) query['max'] = value end value = opts[:search] unless value.nil? query['search'] = 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 DiskReader.read_many(reader) ensure reader.close end else check_fault(response) end end |
- (Service) service(path)
Locates the service corresponding to the given path.
19204 19205 19206 19207 19208 19209 19210 19211 19212 19213 |
# File 'lib/ovirtsdk4/services.rb', line 19204 def service(path) if path.nil? || path == '' return self end index = path.index('/') if index.nil? return disk_service(path) end return disk_service(path[0..(index - 1)]).service(path[(index +1)..-1]) end |
- (String) to_s
Returns an string representation of this service.
19220 19221 19222 |
# File 'lib/ovirtsdk4/services.rb', line 19220 def to_s return "#<#{StorageDomainContentDisksService}:#{@path}>" end |