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.
35339 35340 35341 |
# File 'lib/ovirtsdk4/services.rb', line 35339 def list(opts = {}) internal_get(LIST, opts) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
35361 35362 35363 35364 35365 35366 35367 35368 35369 35370 |
# File 'lib/ovirtsdk4/services.rb', line 35361 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.
35350 35351 35352 |
# File 'lib/ovirtsdk4/services.rb', line 35350 def session_service(id) VmSessionService.new(self, id) end |