Class: OvirtSDK4::VmReportedDevicesService
- Inherits:
-
Service
- Object
- Service
- OvirtSDK4::VmReportedDevicesService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary (collapse)
-
- (Array<ReportedDevice>) list(opts = {})
Returns the representation of the object managed by this service.
-
- (VmReportedDeviceService) reported_device_service(id)
Locates the
reported_device
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
- (Array<ReportedDevice>) list(opts = {})
Returns the representation of the object managed by this service.
26202 26203 26204 26205 26206 26207 26208 26209 26210 26211 26212 26213 26214 26215 26216 26217 26218 26219 26220 26221 26222 |
# File 'lib/ovirtsdk4/services.rb', line 26202 def list(opts = {}) query = {} value = opts[:max] unless value.nil? value = Writer.render_integer(value) query['max'] = 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 ReportedDeviceReader.read_many(reader) ensure reader.close end else check_fault(response) end end |
- (VmReportedDeviceService) reported_device_service(id)
Locates the reported_device
service.
26231 26232 26233 |
# File 'lib/ovirtsdk4/services.rb', line 26231 def reported_device_service(id) return VmReportedDeviceService.new(@connection, "#{@path}/#{id}") end |
- (Service) service(path)
Locates the service corresponding to the given path.
26242 26243 26244 26245 26246 26247 26248 26249 26250 26251 |
# File 'lib/ovirtsdk4/services.rb', line 26242 def service(path) if path.nil? || path == '' return self end index = path.index('/') if index.nil? return reported_device_service(path) end return reported_device_service(path[0..(index - 1)]).service(path[(index +1)..-1]) end |
- (String) to_s
Returns an string representation of this service.
26258 26259 26260 |
# File 'lib/ovirtsdk4/services.rb', line 26258 def to_s return "#<#{VmReportedDevicesService}:#{@path}>" end |