You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "bernardodemarco (via GitHub)" <gi...@apache.org> on 2025/07/10 23:52:18 UTC
[PR] List templates and ISOs by domain [cloudstack]
bernardodemarco opened a new pull request, #11179:
URL: https://github.com/apache/cloudstack/pull/11179
### Description
Currently, it is not possible to list the templates and ISOs of a specific domain. When executing the `listTemplates` and `listIsos` APIs only specifying a `domainid`, all templates/ISOs that the caller has access to are listed; the `domainid` parameter is completely ignored.
Therefore, this PR proposes to add support for listing templates and ISOs by domain. To achieve that, the `listTemplates` and `listIsos` APIs should be called defining the `templatefilter` and `isofilter` parameters to either `self` or `selfexecutable`. Furthermore, the `isrecursive` parameter can be used, to list templates and ISOs recursively by domain.
---
Fixes #10392, #10393
### Types of changes
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Bug fix (non-breaking change which fixes an issue)
- [X] Enhancement (improves an existing feature and functionality)
- [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
- [ ] build/CI
- [ ] test (unit or integration test code)
### Feature/Enhancement Scale or Bug Severity
#### Feature/Enhancement Scale
- [ ] Major
- [X] Minor
### Screenshots (if appropriate):
<img width="691" height="699" alt="image" src="https://github.com/user-attachments/assets/1178e01d-f493-4ab7-9dd5-09e502cb9d7d" />
<img width="1437" height="431" alt="image" src="https://github.com/user-attachments/assets/cb62934f-fc50-4014-9815-cb49eb1175c7" />
### How Has This Been Tested?
- Verified that domain access validation is correctly performed
- Verified that it is possible to list templates and ISOs by domain when specifying the `templatefilter` and `isofilter` parameters to either `self` or `selfexecutable`
- Verified that templates and ISOs are recursively listed when the `isrecursive` parameter is specified as true
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] List templates and ISOs by domain [cloudstack]
Posted by "bernardodemarco (via GitHub)" <gi...@apache.org>.
bernardodemarco commented on PR #11179:
URL: https://github.com/apache/cloudstack/pull/11179#issuecomment-3059615024
@blueorangutan package
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] List templates and ISOs by domain [cloudstack]
Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #11179:
URL: https://github.com/apache/cloudstack/pull/11179#issuecomment-3077940822
@bernardodemarco I tested this in a lab env but still view the default template and system template when browsing from the (child)domain. Anything I might have missed?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] List templates and ISOs by domain [cloudstack]
Posted by "bernardodemarco (via GitHub)" <gi...@apache.org>.
bernardodemarco commented on code in PR #11179:
URL: https://github.com/apache/cloudstack/pull/11179#discussion_r2208775410
##########
server/src/main/java/com/cloud/api/query/QueryManagerImpl.java:
##########
@@ -4490,7 +4493,7 @@ private Pair<List<TemplateJoinVO>, Integer> searchForTemplatesInternal(Long temp
boolean showDomr, boolean onlyReady, List<Account> permittedAccounts, Account caller,
ListProjectResourcesCriteria listProjectResourcesCriteria, Map<String, String> tags,
boolean showRemovedTmpl, List<Long> ids, Long parentTemplateId, Boolean showUnique, String templateType,
- Boolean isVnf) {
+ Boolean isVnf, Long domainId, boolean isRecursive) {
Review Comment:
@DaanHoogland yes, I agree.
IMHO, the overall workflows of the `listIsos` and `listTemplates` APIs could really benefit from refactoring. There's extensive DAO manipulation within the business/service layer, a lack of modularization, and the current structure makes troubleshooting and maintenance difficult.
I'll open a separate issue to address this.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] List templates and ISOs by domain [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #11179:
URL: https://github.com/apache/cloudstack/pull/11179#issuecomment-3059618967
@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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] List templates and ISOs by domain [cloudstack]
Posted by "sureshanaparti (via GitHub)" <gi...@apache.org>.
sureshanaparti commented on PR #11179:
URL: https://github.com/apache/cloudstack/pull/11179#issuecomment-3069213843
@blueorangutan package
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] List templates and ISOs by domain [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #11179:
URL: https://github.com/apache/cloudstack/pull/11179#issuecomment-3072207934
@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] List templates and ISOs by domain [cloudstack]
Posted by "bernardodemarco (via GitHub)" <gi...@apache.org>.
bernardodemarco commented on code in PR #11179:
URL: https://github.com/apache/cloudstack/pull/11179#discussion_r2208789938
##########
server/src/main/java/com/cloud/api/query/QueryManagerImpl.java:
##########
@@ -4490,7 +4493,7 @@ private Pair<List<TemplateJoinVO>, Integer> searchForTemplatesInternal(Long temp
boolean showDomr, boolean onlyReady, List<Account> permittedAccounts, Account caller,
ListProjectResourcesCriteria listProjectResourcesCriteria, Map<String, String> tags,
boolean showRemovedTmpl, List<Long> ids, Long parentTemplateId, Boolean showUnique, String templateType,
- Boolean isVnf) {
+ Boolean isVnf, Long domainId, boolean isRecursive) {
Review Comment:
Done, #11209
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] List templates and ISOs by domain [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #11179:
URL: https://github.com/apache/cloudstack/pull/11179#issuecomment-3070157558
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 14172
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] List templates and ISOs by domain [cloudstack]
Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on code in PR #11179:
URL: https://github.com/apache/cloudstack/pull/11179#discussion_r2202539352
##########
server/src/main/java/com/cloud/api/query/QueryManagerImpl.java:
##########
@@ -4490,7 +4493,7 @@ private Pair<List<TemplateJoinVO>, Integer> searchForTemplatesInternal(Long temp
boolean showDomr, boolean onlyReady, List<Account> permittedAccounts, Account caller,
ListProjectResourcesCriteria listProjectResourcesCriteria, Map<String, String> tags,
boolean showRemovedTmpl, List<Long> ids, Long parentTemplateId, Boolean showUnique, String templateType,
- Boolean isVnf) {
+ Boolean isVnf, Long domainId, boolean isRecursive) {
Review Comment:
I am not a fan of extending parameter lists beyond three. It already was, but we should think about passing the command or an interface the command adheres to instead. Not necessarily in this PR but keep in mind this is a maintainability issue. a lot of these are directly retrieved from the cmd object.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] List templates and ISOs by domain [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #11179:
URL: https://github.com/apache/cloudstack/pull/11179#issuecomment-3069214937
@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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] List templates and ISOs by domain [cloudstack]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #11179:
URL: https://github.com/apache/cloudstack/pull/11179#issuecomment-3059604188
## [Codecov](https://app.codecov.io/gh/apache/cloudstack/pull/11179?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Project coverage is 4.28%. Comparing base [(`7715b3d`)](https://app.codecov.io/gh/apache/cloudstack/commit/7715b3dc29876e6a414b9269a0255fb3c3ceff1f?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`1554d1a`)](https://app.codecov.io/gh/apache/cloudstack/commit/1554d1adc3b083616fe1d0a35eb073db25e0b1e7?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
> :exclamation: There is a different number of reports uploaded between BASE (7715b3d) and HEAD (1554d1a). Click for more details.
>
> <details><summary>HEAD has 1 upload less than BASE</summary>
>
>| Flag | BASE (7715b3d) | HEAD (1554d1a) |
>|------|------|------|
>|unittests|1|0|
></details>
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## 4.19 #11179 +/- ##
=============================================
- Coverage 15.18% 4.28% -10.91%
=============================================
Files 5415 372 -5043
Lines 475868 29746 -446122
Branches 58092 5230 -52862
=============================================
- Hits 72252 1274 -70978
+ Misses 395531 28327 -367204
+ Partials 8085 145 -7940
```
| [Flag](https://app.codecov.io/gh/apache/cloudstack/pull/11179/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [uitests](https://app.codecov.io/gh/apache/cloudstack/pull/11179/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `4.28% <ø> (-0.01%)` | :arrow_down: |
| [unittests](https://app.codecov.io/gh/apache/cloudstack/pull/11179/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/cloudstack/pull/11179?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] List templates and ISOs by domain [cloudstack]
Posted by "bernardodemarco (via GitHub)" <gi...@apache.org>.
bernardodemarco commented on PR #11179:
URL: https://github.com/apache/cloudstack/pull/11179#issuecomment-3079272007
> I would expect those to be set by the UI when browsing from the domain page, no?
@DaanHoogland, yes, for sure. I assumed you were performing the API calls directly from CloudMonkey
Can you share the API request the UI is performing (through the browser's inspect tab)?
Also, could you verify the URL the UI is redirecting the caller user to? It should be something like this
<img width="1437" height="431" alt="image" src="https://github.com/user-attachments/assets/7dac6a80-bdea-4ff0-a85f-3c28a5a7ff11" />
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] List templates and ISOs by domain [cloudstack]
Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #11179:
URL: https://github.com/apache/cloudstack/pull/11179#issuecomment-3082852236
> > I would expect those to be set by the UI when browsing from the domain page, no?
>
> @DaanHoogland, yes, for sure. I assumed you were performing the API calls directly from CloudMonkey
All is good @bernardodemarco , I learned two things:
- I am working on too much at the same time and tested your functionality in an env without your changes 🤦 .
- when you select a domain and not an account the ownership defaults back to ROOT and what I suppose would be the caller account.
I am not sure if this second point is worth an issue. In any case we are good to go with this PR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] List templates and ISOs by domain [cloudstack]
Posted by "bernardodemarco (via GitHub)" <gi...@apache.org>.
bernardodemarco commented on PR #11179:
URL: https://github.com/apache/cloudstack/pull/11179#issuecomment-3079167217
> @bernardodemarco I tested this in a lab env but still view the default template and system template when browsing from the (child)domain. Anything I might have missed?
@DaanHoogland, thanks for testing!
Have you defined the `templatefilter` and `isofilter` parameters to be equal to either `self` or `selfexecutable`? If so, could you share the API calls that have been performed?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] List templates and ISOs by domain [cloudstack]
Posted by "bernardodemarco (via GitHub)" <gi...@apache.org>.
bernardodemarco commented on PR #11179:
URL: https://github.com/apache/cloudstack/pull/11179#issuecomment-3059590930
@DaanHoogland @shwstppr @sureshanaparti targeting this PR to the 4.19 branch because the #10392 milestone is set to `4.19.4`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] List templates and ISOs by domain [cloudstack]
Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #11179:
URL: https://github.com/apache/cloudstack/pull/11179#issuecomment-3072201688
@blueorangutan test keepEnv
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] List templates and ISOs by domain [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #11179:
URL: https://github.com/apache/cloudstack/pull/11179#issuecomment-3075428798
<b>[SF] Trillian test result (tid-13776)</b>
Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 46175 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr11179-t13776-kvm-ol8.zip
Smoke tests completed. 133 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:
Test | Result | Time (s) | Test File
--- | --- | --- | ---
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] List templates and ISOs by domain [cloudstack]
Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland merged PR #11179:
URL: https://github.com/apache/cloudstack/pull/11179
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] List templates and ISOs by domain [cloudstack]
Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #11179:
URL: https://github.com/apache/cloudstack/pull/11179#issuecomment-3079234831
> > @bernardodemarco I tested this in a lab env but still view the default template and system template when browsing from the (child)domain. Anything I might have missed?
>
> @DaanHoogland, thanks for testing!
>
> Have you defined the `templatefilter` and `isofilter` parameters to be equal to either `self` or `selfexecutable`? If so, could you share the API calls that have been performed?
I would expect those to be set by the UI when browsing from the domain page, no?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] List templates and ISOs by domain [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #11179:
URL: https://github.com/apache/cloudstack/pull/11179#issuecomment-3059772983
Packaging result [SF]: ✔️ el8 ✔️ el9 ✖️ debian ✔️ suse15. SL-JID 14132
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org