-
Notifications
You must be signed in to change notification settings - Fork 1.2k
API to list console sessions #11016
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
API to list console sessions #11016
Conversation
@blueorangutan package |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #11016 +/- ##
============================================
+ Coverage 17.17% 17.19% +0.02%
- Complexity 14985 15017 +32
============================================
Files 5869 5871 +2
Lines 521590 521896 +306
Branches 63485 63504 +19
============================================
+ Hits 89562 89739 +177
- Misses 421962 422087 +125
- Partials 10066 10070 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@blueorangutan package |
@bernardodemarco a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 13755 |
79f6d2d
to
ad7af57
Compare
@blueorangutan package |
@bernardodemarco a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clgtm, only doubt, is the active parameter needed? would we ever want to list no longer available sessions?
Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 13766 |
Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 13771 |
@DaanHoogland, thanks for the review!
Yes, listing removed sessions is useful for audit and analysis purposes, as it allows users to track who generated a console endpoint, who accessed it, and when it was generated, acquired, and removed. Listing only active sessions, on the other hand, is helpful for verifying whether someone is currently using a VM. |
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13777 |
@blueorangutan test |
@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
[SF] Trillian test result (tid-13527)
|
@blueorangutan test ol8 vmware-70u3 keepEnv |
@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + vmware-70u3) has been kicked to run smoke tests |
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
@bernardodemarco @winterhazel can you check the conflicts |
…leproxy/ListConsoleSessionsCmd.java Co-authored-by: Nicolas Vazquez <nicovazquez90@gmail.com>
…eAccessManagerImpl.java Co-authored-by: Nicolas Vazquez <nicovazquez90@gmail.com>
00a3796
to
dc67763
Compare
@blueorangutan package |
@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
@shwstppr, @winterhazel, @sureshanaparti, @nvazquez as suggested, I renamed the Therefore, I'll close the apache/cloudstack-cloudmonkey#162 PR, that intended to add autocomplete support for the |
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 14442 |
@blueorangutan test |
@sureshanaparti a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
[SF] Trillian test result (tid-13967)
|
Description
Currently, details about console sessions are stored in the
cloud.console_session
table in the database. Operators can only access this information by querying the database directly, while end users have no way to view console session data at all.To address this, this PR proposes to create the
listConsoleSessions
API. It allows listing the console sessions, with optional filters by domain, account, user, host, instance, IP address, and date. The API is accessible to all account types and, thus, performs proper access validation on the queried resources.The API supports the following parameters:
id
activeonly
true
. Active sessions are the ones that have been acquired and have not been removed.acquired
false
. Acquired sessions are the ones that have been accessed. Theactiveonly
parameter has precedence over theacquired
parameter, i.e., when theactiveonly
parameter istrue
, theacquired
parameter value will be ignored.isrecursive
false
.clientaddress
consoleendpointcreatoraddress
hostid
virtualmachineid
startdate
enddate
domainid
accountid
userid
page
pagesize
.pagesize
page
.This PR only encompasses the creation of the API
listConsoleSessions
API. UI support will be implemented in a future PR.Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Screenshots (if appropriate):
How Has This Been Tested?
Tests Setup
listConsoleSessions
testsadmin
account, verified that the API lists console sessions correctly according to the specified parametersu1
account, verified that it is only possible to access the account's console sessionsd2-admin
account, verified that it is only possible to list the console sessions of thed2
domaind1-admin
account, verified that it is only possible to list the console sessions of thed1
andd1/d1-d1
domainsd1-user
account, verified that it is only possible to list thed1-user
console sessionsd1-d1-admin
account, verified that it is only possible to list the console sessions of thed1/d1-d1
domaind1-d1-user
account, verified that it is only possible to list thed1-d1-user
console sessionsUser
type, verified that thehostid
parameter is not considered in the API workflowUser
type, verified that thehostid
andhostname
response attributes are not included in the API's return