-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Improve Quota Statement #10506
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?
Improve Quota Statement #10506
Conversation
@blueorangutan package |
@julien-vaz 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 12669 |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #10506 +/- ##
============================================
+ Coverage 16.15% 16.27% +0.11%
- Complexity 13273 13402 +129
============================================
Files 5666 5680 +14
Lines 498081 499213 +1132
Branches 60267 60360 +93
============================================
+ Hits 80475 81246 +771
- Misses 408593 408929 +336
- Partials 9013 9038 +25
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 |
@julien-vaz 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 12689 |
…uotaServiceImplTest
I've just successfully builded the packages locally with |
@blueorangutan package |
@julien-vaz 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 12742 |
plugins/database/quota/src/main/java/org/apache/cloudstack/api/command/QuotaStatementCmd.java
Outdated
Show resolved
Hide resolved
...atabase/quota/src/main/java/org/apache/cloudstack/api/response/QuotaResponseBuilderImpl.java
Outdated
Show resolved
Hide resolved
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
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
} | ||
logger.debug("Creating quota statement from [{}] usage records for parameters [{}].", quotaUsages.size(), | ||
ReflectionToStringBuilderUtils.reflectOnlySelectedFields(cmd, "accountName", "accountId", "domainId", "startDate", "endDate", "type", "showDetails")); |
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.
this seems the reuse of the same array of strings. Not for this PR but maybe we should allow String[] as parameter for ReflectionToStringBuilderUtils.reflectOnlySelectedFields
. Or allow some kind of predefined default per class to be registered.
@@ -469,11 +599,11 @@ protected void warnQuotaTariffUpdateDeprecatedFields(QuotaTariffUpdateCmd cmd) { | |||
String warnMessage = "The parameter 's%s' for API 'quotaTariffUpdate' is no longer needed and it will be removed in future releases."; |
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.
this can be modern format now (not calling the String.format
on the warn
s), can it?
Description
In the current version, the
quotaStatement
API is returning the internal ID for account and domain, which is not useful for users, since all APIs use/return the UUID. Also, when theusage_type
parameter is informed, the API shows dummy records.To address those problems:
showresources
was added to display more information to the user about each usage type;quotaStatementDetails
API was created to list more details about each usage type;Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
How Has This Been Tested?
On CloudMonkey the
quotaStatement
API was called and:usage_type
no dummy records were showed;showresources
parameter is properly working;The
quotaStatementDetails
API was called successfully as well.