Introduce domainid and account parameter in createTemplate API#8210
Introduce domainid and account parameter in createTemplate API#8210shwstppr merged 3 commits intoapache:mainfrom sudo87:createcmd
Conversation
|
Congratulations on your first Pull Request and welcome to the Apache CloudStack community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md)
|
DaanHoogland
left a comment
There was a problem hiding this comment.
clgtm, good functionality enhancement and good refactor. just one suggestion for improvment
api/src/main/java/org/apache/cloudstack/api/command/user/template/CreateTemplateCmd.java
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## main #8210 +/- ##
============================================
- Coverage 29.19% 29.17% -0.03%
- Complexity 31026 31044 +18
============================================
Files 5181 5186 +5
Lines 365434 365785 +351
Branches 53449 53487 +38
============================================
+ Hits 106700 106712 +12
- Misses 244113 244474 +361
+ Partials 14621 14599 -22
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 45 files with indirect coverage changes 📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today! |
|
@blueorangutan package |
|
@rohityadavcloud 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]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 7699 |
api/src/main/java/org/apache/cloudstack/api/command/user/template/CreateTemplateCmd.java
Outdated
Show resolved
Hide resolved
api/src/main/java/org/apache/cloudstack/api/command/user/template/CreateTemplateCmd.java
Outdated
Show resolved
Hide resolved
shwstppr
left a comment
There was a problem hiding this comment.
Idea looks correct and consistent with ACS template behaviour as the templates are owned by an account and not a domain.
Added some comments on the code bits
api/src/main/java/org/apache/cloudstack/api/command/user/template/CreateTemplateCmd.java
Outdated
Show resolved
Hide resolved
api/src/main/java/org/apache/cloudstack/api/command/user/template/CreateTemplateCmd.java
Outdated
Show resolved
Hide resolved
api/src/main/java/org/apache/cloudstack/api/command/user/template/CreateTemplateCmd.java
Outdated
Show resolved
Hide resolved
1. Created separate methods for access check and obtaining accountId 2. Included since property in params 3. Catching specific exceptions instead of all 4. Modified exception log to warn, included debug log 5. Removed projectId block as it's taken care in _accountService.finalyzeAccountId method
|
Performed tests (attached txt) with latest commit. |
api/src/main/java/org/apache/cloudstack/api/command/user/template/CreateTemplateCmd.java
Outdated
Show resolved
Hide resolved
|
@blueorangutan package |
|
@shwstppr 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]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 7718 |
|
@blueorangutan test |
|
@shwstppr a [SL] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-8306)
|
|
@blueorangutan package |
|
@shwstppr 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]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 7725 |
|
@blueorangutan test |
|
@DaanHoogland a [SL] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-8311)
|
|
@blueorangutan package |
|
@rohityadavcloud 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]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 7739 |
shwstppr
left a comment
There was a problem hiding this comment.
Code looks good and the last test run with k8s failures seem unrelated
|
@shwstppr do we need more testing on this or do we merge? |
|
@DaanHoogland lets merge unless we have any other objections cc @rohityadavcloud |
|
Tested by creating a template for a account - |
|
Merging this. We may need to add UI support for new params at some point. @sudo87 feel free to open a new PR if you wish to do so. |
|
Awesome work, congrats on your first merged pull request! |
|
Thanks @shwstppr @DaanHoogland for merging the pr. |
This PR includes Domain and Account parameters in CreateTemplate form in UI for Admin account. It will expose optional parameters domainId and account in UI supported by createTemplate API #8210
…pache#8210) Introduces domainid and account as optional parameter for createTemplate API. It will allow admin to create templates for specified domain belonging to specific account.
…#8257) This PR includes Domain and Account parameters in CreateTemplate form in UI for Admin account. It will expose optional parameters domainId and account in UI supported by createTemplate API apache#8210

Description
This PR introduces domainid and account as optional parameter for createTemplate API. It will allow admin to create templates for specified domain belonging to specific account.
Fixes: #5793 (comment)
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
It's tested using 2 different users belonging to separate domains,
How did you try to break this feature and the system with this change?