Class: OvirtSDK4::VmSessionsService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary collapse
-
#list(opts = {}) ⇒ Array<Session>
Lists all user sessions for this virtual machine.
-
#service(path) ⇒ Service
Locates the service corresponding to the given path.
-
#session_service(id) ⇒ VmSessionService
Reference to the service that manages a specific session.
Methods inherited from Service
Instance Method Details
#list(opts = {}) ⇒ Array<Session>
Lists all user sessions for this virtual machine.
For example, to retrieve the session information for virtual machine 123
send a request like this:
GET /ovirt-engine/api/vms/123/sessions
The response body will contain something like this:
<sessions>
<session href="/ovirt-engine/api/vms/123/sessions/456" id="456">
<console_user>true</console_user>
<ip>
<address>192.168.122.1</address>
</ip>
<user href="/ovirt-engine/api/users/789" id="789"/>
<vm href="/ovirt-engine/api/vms/123" id="123"/>
</session>
...
</sessions>
The order of the returned list of sessions isn’t guaranteed.
31989 31990 31991 |
# File 'lib/ovirtsdk4/services.rb', line 31989 def list(opts = {}) internal_get(LIST, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
32011 32012 32013 32014 32015 32016 32017 32018 32019 32020 |
# File 'lib/ovirtsdk4/services.rb', line 32011 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 |
#session_service(id) ⇒ VmSessionService
Reference to the service that manages a specific session.
32000 32001 32002 |
# File 'lib/ovirtsdk4/services.rb', line 32000 def session_service(id) VmSessionService.new(self, id) end |