Class: OvirtSDK4::VmSessionsService
- Inherits:
-
Service
- Object
- Service
- OvirtSDK4::VmSessionsService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary (collapse)
-
- (Array<Session>) list(opts = {})
Returns the representation of the object managed by this service.
-
- (Service) service(path)
Locates the service corresponding to the given path.
-
- (VmSessionService) session_service(id)
Locates the
session
service. -
- (String) to_s
Returns an string representation of this service.
Instance Method Details
- (Array<Session>) list(opts = {})
Returns the representation of the object managed by this service.
26354 26355 26356 26357 26358 26359 26360 26361 26362 26363 26364 26365 26366 26367 26368 26369 26370 26371 26372 26373 26374 |
# File 'lib/ovirtsdk4/services.rb', line 26354 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 SessionReader.read_many(reader) ensure reader.close end else check_fault(response) end end |
- (Service) service(path)
Locates the service corresponding to the given path.
26394 26395 26396 26397 26398 26399 26400 26401 26402 26403 |
# File 'lib/ovirtsdk4/services.rb', line 26394 def service(path) if path.nil? || path == '' return self end index = path.index('/') if index.nil? return session_service(path) end return session_service(path[0..(index - 1)]).service(path[(index +1)..-1]) end |
- (VmSessionService) session_service(id)
Locates the session
service.
26383 26384 26385 |
# File 'lib/ovirtsdk4/services.rb', line 26383 def session_service(id) return VmSessionService.new(@connection, "#{@path}/#{id}") end |
- (String) to_s
Returns an string representation of this service.
26410 26411 26412 |
# File 'lib/ovirtsdk4/services.rb', line 26410 def to_s return "#<#{VmSessionsService}:#{@path}>" end |