Class: OvirtSDK4::SnapshotCdromsService
- Inherits:
-
Service
- Object
- Service
- OvirtSDK4::SnapshotCdromsService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary (collapse)
-
- (SnapshotCdromService) cdrom_service(id)
Locates the
cdrom
service. -
- (Array<Cdrom>) 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
- (SnapshotCdromService) cdrom_service(id)
Locates the cdrom
service.
17481 17482 17483 |
# File 'lib/ovirtsdk4/services.rb', line 17481 def cdrom_service(id) return SnapshotCdromService.new(@connection, "#{@path}/#{id}") end |
- (Array<Cdrom>) list(opts = {})
Returns the representation of the object managed by this service.
17452 17453 17454 17455 17456 17457 17458 17459 17460 17461 17462 17463 17464 17465 17466 17467 17468 17469 17470 17471 17472 |
# File 'lib/ovirtsdk4/services.rb', line 17452 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 CdromReader.read_many(reader) ensure reader.close end else check_fault(response) end end |
- (Service) service(path)
Locates the service corresponding to the given path.
17492 17493 17494 17495 17496 17497 17498 17499 17500 17501 |
# File 'lib/ovirtsdk4/services.rb', line 17492 def service(path) if path.nil? || path == '' return self end index = path.index('/') if index.nil? return cdrom_service(path) end return cdrom_service(path[0..(index - 1)]).service(path[(index +1)..-1]) end |
- (String) to_s
Returns an string representation of this service.
17508 17509 17510 |
# File 'lib/ovirtsdk4/services.rb', line 17508 def to_s return "#<#{SnapshotCdromsService}:#{@path}>" end |