Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-05-27 Thread via GitHub


GutoVeronezi merged PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243


-- 
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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-05-27 Thread via GitHub


GutoVeronezi commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-2133664813

   Merging as the tests errors are not related to the 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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-05-02 Thread via GitHub


DaanHoogland commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-2090505983

   > @DaanHoogland there seems to be a problem with `test_events_resource.py`. 
It's failing in other PRs recently too: [#8981 
(comment)](https://github.com/apache/cloudstack/pull/8981#issuecomment-2080231020)
   
   yes, see 
https://github.com/apache/cloudstack/issues/8931#issuecomment-2076564715 and 
replies


-- 
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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-05-02 Thread via GitHub


winterhazel commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-2090294805

   @DaanHoogland there seems to be a problem with `test_events_resource.py`. 
It's failing in other PRs recently too: 
https://github.com/apache/cloudstack/pull/8981#issuecomment-2080231020


-- 
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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-04-29 Thread via GitHub


blueorangutan commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-2083782913

   [SF] Trillian test result (tid-10070)
   Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 50826 seconds
   Marvin logs: 
https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr8243-t10070-kvm-centos7.zip
   Smoke tests completed. 128 look OK, 2 have errors, 0 did not run
   Only failed and skipped tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_01_events_resource | `Error` | 424.17 | test_events_resource.py
   test_02_list_cpvm_vm | `Failure` | 0.04 | test_ssvm.py
   test_04_cpvm_internals | `Failure` | 0.05 | test_ssvm.py
   


-- 
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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-04-29 Thread via GitHub


blueorangutan commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-2082073437

   @DaanHoogland a [SL] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) 
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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-04-29 Thread via GitHub


DaanHoogland commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-2082069861

   @blueorangutan test


-- 
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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-04-26 Thread via GitHub


blueorangutan commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-2080341492

   [SF] Trillian test result (tid-10052)
   Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 51115 seconds
   Marvin logs: 
https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr8243-t10052-kvm-centos7.zip
   Smoke tests completed. 128 look OK, 2 have errors, 0 did not run
   Only failed and skipped tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_01_events_resource | `Error` | 436.58 | test_events_resource.py
   test_02_trigger_shutdown | `Failure` | 357.31 | test_safe_shutdown.py
   


-- 
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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-04-26 Thread via GitHub


blueorangutan commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-2079309332

   @DaanHoogland a [SL] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) 
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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-04-26 Thread via GitHub


DaanHoogland commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-2079306991

   @blueorangutan test


-- 
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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-04-26 Thread via GitHub


winterhazel commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-2079286992

   @DaanHoogland GHI tests are passing now ;)
   
   Can you run the CI one last time so we can proceed 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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-04-25 Thread via GitHub


blueorangutan commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-2077166383

   Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 9425


-- 
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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-04-25 Thread via GitHub


winterhazel commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-2077007474

   @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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-04-25 Thread via GitHub


blueorangutan commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-2077008276

   @winterhazel 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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-04-15 Thread via GitHub


DaanHoogland closed pull request #8243: Normalize dates in Usage and Quota APIs
URL: https://github.com/apache/cloudstack/pull/8243


-- 
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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-04-15 Thread via GitHub


winterhazel commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-2057156177

   @DaanHoogland most of the GHI tests are failing due to an error with 
Codecov, which is also happening in other PRs, such as #8890.
   
   ```
   [2024-04-13T09:52:32.198Z] ['error'] There was an error running the 
uploader: Error uploading to https://codecov.io/: Error: There was an error 
fetching the storage URL during POST: 404 - {'detail': 
ErrorDetail(string='Unable to locate build via Github Actions API. Please 
upload with the Codecov repository upload token to resolve issue.', 
code='not_found')}
   ```
   The only exceptions are two failures in `test_network_permissions`, but this 
same test has finished successfully in the last CI run.
   
   ```
   Testing network permissions on project network ... === TestName: 
test_01_network_permission_on_project_network | Status : SUCCESS ===
   ok
   Testing network permissions on user network ... === TestName: 
test_02_network_permission_on_user_network | Status : SUCCESS ===
   ok
   Testing network operations on a create vm owned by other user ... === 
TestName: test_03_network_operations_on_created_vm_of_otheruser | Status : 
SUCCESS ===
   ok
   Deploy VM for other user and test VM operations by vm owner, network owner 
and domain admin ... === TestName: 
test_04_deploy_vm_for_other_user_and_test_vm_operations | Status : SUCCESS ===
   ok
   Testing list networks under a project ... === TestName: 
test_05_list_networks_under_project | Status : SUCCESS ===
   ok
   Testing list networks under a domain admin account and user account ... === 
TestName: test_06_list_networks_under_account | Status : SUCCESS ===
   ok
   
   --
   Ran 6 tests in 348.471s
   
   OK
   ```
   
   And the two tests that failed in the last run are failing in unrelated PRs 
as well: https://github.com/apache/cloudstack/pull/8511#issuecomment-1977729767.


-- 
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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-04-15 Thread via GitHub


DaanHoogland commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-2055975494

   @winterhazel I think the smoke test results are environmental, but all but 
the most trivial GHI tests fail. Can you have a look?


-- 
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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-04-13 Thread via GitHub


blueorangutan commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-2053789798

   [SF] Trillian test result (tid-9822)
   Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 48900 seconds
   Marvin logs: 
https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr8243-t9822-kvm-centos7.zip
   Smoke tests completed. 128 look OK, 1 have errors, 0 did not run
   Only failed and skipped tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_02_list_cpvm_vm | `Failure` | 0.04 | test_ssvm.py
   test_04_cpvm_internals | `Failure` | 0.05 | test_ssvm.py
   


-- 
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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-04-13 Thread via GitHub


DaanHoogland closed pull request #8243: Normalize dates in Usage and Quota APIs
URL: https://github.com/apache/cloudstack/pull/8243


-- 
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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-04-13 Thread via GitHub


blueorangutan commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-2053583054

   @DaanHoogland a [SL] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) 
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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-04-13 Thread via GitHub


DaanHoogland commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-2053582414

   @blueorangutan test


-- 
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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-04-12 Thread via GitHub


GutoVeronezi commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-2052271599

   The Simulator CI / build is passing; however, Codecov is struggling with 
something during the report upload; thus the errors in the checks. 
   
   @DaanHoogland, can we do a last CI run for this one?


-- 
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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-04-08 Thread via GitHub


blueorangutan commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-2043732856

   Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 9197


-- 
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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-04-08 Thread via GitHub


blueorangutan commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-2043636331

   @winterhazel 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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-04-08 Thread via GitHub


winterhazel commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-2043632913

   @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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-04-08 Thread via GitHub


winterhazel commented on code in PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#discussion_r1556424510


##
plugins/database/quota/src/main/java/org/apache/cloudstack/api/command/QuotaBalanceCmd.java:
##
@@ -43,10 +43,12 @@ public class QuotaBalanceCmd extends BaseCmd {
 @Parameter(name = ApiConstants.DOMAIN_ID, type = CommandType.UUID, 
required = true, entityType = DomainResponse.class, description = "If domain Id 
is given and the caller is domain admin then the statement is generated for 
domain.")
 private Long domainId;
 
-@Parameter(name = ApiConstants.END_DATE, type = CommandType.DATE, 
description = "End date range for quota query. Use -MM-dd as the date 
format, e.g. startDate=2009-06-03.")
+@Parameter(name = ApiConstants.END_DATE, type = CommandType.DATE, 
description = "End date range for quota query. " +
+ApiConstants.PARAMETER_DESCRIPTION_END_DATE_POSSIBLE_FORMATS)
 private Date endDate;
 
-@Parameter(name = ApiConstants.START_DATE, type = CommandType.DATE, 
description = "Start date range quota query. Use -MM-dd as the date format, 
e.g. startDate=2009-06-01.")
+@Parameter(name = ApiConstants.START_DATE, type = CommandType.DATE, 
description = "Start date range quota query. " +

Review Comment:
   ```suggestion
   @Parameter(name = ApiConstants.START_DATE, type = CommandType.DATE, 
description = "Start of the period of the Quota balance. " +
   ```



-- 
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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-04-08 Thread via GitHub


GutoVeronezi commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-2043303604

   > > @winterhazel, you mentioned in the description that this PR also affects 
quotaStatement and quotaBalance; however, I am not seeing changes in their 
command classes. Could you check?
   > 
   > The changes I mentioned were made in their workflow, not in their command 
classes.
   > 
   > Regarding `quotaStatement`, the following block has been removed from 
`org.apache.cloudstack.quota.QuotaServiceImpl#getQuotaUsage` to allow providing 
end dates in the future:
   > 
   > ```diff
   > -if (endDate.after(_respBldr.startOfNextDay())) {
   > -throw new InvalidParameterValueException("Incorrect Date 
Range. End date:" + endDate + " should not be in future. ");
   > -}
   > ```
   > 
   > The same restriction has been removed for `quotaBalance` in 
`org.apache.cloudstack.quota.QuotaServiceImpl#findQuotaBalanceVO`:
   > 
   > ```diff
   > -Date adjustedStartDate = computeAdjustedTime(startDate);
   > -if (endDate.after(_respBldr.startOfNextDay())) {
   > -throw new InvalidParameterValueException("Incorrect Date 
Range. End date:" + endDate + " should not be in future. ");
   > -} else if (startDate.before(endDate)) {
   > -Date adjustedEndDate = computeAdjustedTime(endDate);
   > +if (startDate.before(endDate)) {
   > ```
   > 
   > > Also, I checked the code and observed that both have an odd behavior: 
they take the end date passed as parameters and calculate the next day to it, 
to use it as the end date, instead of using what the caller passed, which means 
it would not retrieve what the caller requested. It would be good to check this 
behavior as well (Adjustment 2).
   > 
   > We can check if this behavior makes sense and, if it does not, change how 
these two APIs use the provided end date; but I think this change starts to get 
out of the scope of this PR, and should be done in a separate one.
   > 
   > > @winterhazel, you mentioned the API quotaTariffDelete in the PR's 
description; however, I am not seeing changes in its command class. I also 
checked the code and have not found a reason for this API being handled in this 
PR. Was it a typo?
   > 
   > As well as `quotaStatement` and `quotaBalance`, the mentioned change was 
made in the workflow, not in the command class. In 
`org.apache.cloudstack.api.response.QuotaResponseBuilderImpl#deleteQuotaTariff`,
 I made it so that the actual removal date is persisted instead of a 
manipulated one:
   > 
   > ```diff
   > -quotaTariff.setRemoved(_quotaService.computeAdjustedTime(new 
Date()));
   > +quotaTariff.setRemoved(new Date());
   > ```
   
   Thanks for the explanation, @winterhazel. It makes sense to handle/discuss 
the `endDate` case in another 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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-04-08 Thread via GitHub


GutoVeronezi commented on code in PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#discussion_r1556182305


##
plugins/database/quota/src/main/java/org/apache/cloudstack/api/command/QuotaBalanceCmd.java:
##
@@ -43,10 +43,12 @@ public class QuotaBalanceCmd extends BaseCmd {
 @Parameter(name = ApiConstants.DOMAIN_ID, type = CommandType.UUID, 
required = true, entityType = DomainResponse.class, description = "If domain Id 
is given and the caller is domain admin then the statement is generated for 
domain.")
 private Long domainId;
 
-@Parameter(name = ApiConstants.END_DATE, type = CommandType.DATE, 
description = "End date range for quota query. Use -MM-dd as the date 
format, e.g. startDate=2009-06-03.")
+@Parameter(name = ApiConstants.END_DATE, type = CommandType.DATE, 
description = "End date range for quota query. " +

Review Comment:
   ```suggestion
   @Parameter(name = ApiConstants.END_DATE, type = CommandType.DATE, 
description = "End of the period of the Quota balance." +
   ```



##
plugins/database/quota/src/main/java/org/apache/cloudstack/api/command/QuotaStatementCmd.java:
##
@@ -45,10 +45,12 @@ public class QuotaStatementCmd extends BaseCmd {
 @Parameter(name = ApiConstants.DOMAIN_ID, type = CommandType.UUID, 
required = true, entityType = DomainResponse.class, description = "Optional, If 
domain Id is given and the caller is domain admin then the statement is 
generated for domain.")
 private Long domainId;
 
-@Parameter(name = ApiConstants.END_DATE, type = CommandType.DATE, required 
= true, description = "End date range for quota query. Use -MM-dd as the 
date format, e.g. startDate=2009-06-03.")
+@Parameter(name = ApiConstants.END_DATE, type = CommandType.DATE, required 
= true, description = "End date range for quota query. " +
+ApiConstants.PARAMETER_DESCRIPTION_END_DATE_POSSIBLE_FORMATS)
 private Date endDate;
 
-@Parameter(name = ApiConstants.START_DATE, type = CommandType.DATE, 
required = true, description = "Start date range quota query. Use -MM-dd as 
the date format, e.g. startDate=2009-06-01.")
+@Parameter(name = ApiConstants.START_DATE, type = CommandType.DATE, 
required = true, description = "Start date range quota query. " +

Review Comment:
   ```suggestion
   @Parameter(name = ApiConstants.START_DATE, type = CommandType.DATE, 
required = true, description = "Start of the period of the Quota statement. " +
   ```



##
plugins/database/quota/src/main/java/org/apache/cloudstack/api/command/QuotaBalanceCmd.java:
##
@@ -43,10 +43,12 @@ public class QuotaBalanceCmd extends BaseCmd {
 @Parameter(name = ApiConstants.DOMAIN_ID, type = CommandType.UUID, 
required = true, entityType = DomainResponse.class, description = "If domain Id 
is given and the caller is domain admin then the statement is generated for 
domain.")
 private Long domainId;
 
-@Parameter(name = ApiConstants.END_DATE, type = CommandType.DATE, 
description = "End date range for quota query. Use -MM-dd as the date 
format, e.g. startDate=2009-06-03.")
+@Parameter(name = ApiConstants.END_DATE, type = CommandType.DATE, 
description = "End date range for quota query. " +
+ApiConstants.PARAMETER_DESCRIPTION_END_DATE_POSSIBLE_FORMATS)
 private Date endDate;
 
-@Parameter(name = ApiConstants.START_DATE, type = CommandType.DATE, 
description = "Start date range quota query. Use -MM-dd as the date format, 
e.g. startDate=2009-06-01.")
+@Parameter(name = ApiConstants.START_DATE, type = CommandType.DATE, 
description = "Start date range quota query. " +

Review Comment:
   ```suggestion
   @Parameter(name = ApiConstants.START_DATE, type = CommandType.DATE, 
description = "Start of the period of the Quota Balance. " +
   ```



##
plugins/database/quota/src/main/java/org/apache/cloudstack/api/command/QuotaStatementCmd.java:
##
@@ -45,10 +45,12 @@ public class QuotaStatementCmd extends BaseCmd {
 @Parameter(name = ApiConstants.DOMAIN_ID, type = CommandType.UUID, 
required = true, entityType = DomainResponse.class, description = "Optional, If 
domain Id is given and the caller is domain admin then the statement is 
generated for domain.")
 private Long domainId;
 
-@Parameter(name = ApiConstants.END_DATE, type = CommandType.DATE, required 
= true, description = "End date range for quota query. Use -MM-dd as the 
date format, e.g. startDate=2009-06-03.")
+@Parameter(name = ApiConstants.END_DATE, type = CommandType.DATE, required 
= true, description = "End date range for quota query. " +

Review Comment:
   ```suggestion
   @Parameter(name = ApiConstants.END_DATE, type = CommandType.DATE, 
required = true, description = "End of the period of the Quota statement. " +
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL 

Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-04-05 Thread via GitHub


blueorangutan commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-2040148045

   Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 9175


-- 
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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-04-05 Thread via GitHub


blueorangutan commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-2039970366

   @winterhazel 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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-04-05 Thread via GitHub


winterhazel commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-2039966109

   @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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-04-05 Thread via GitHub


winterhazel commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-2039964793

   @GutoVeronezi this PR should be ready as it is currently, could you take 
another look at it?
   
   I just made a small change in the description of some params as I noticed 
that they were lacking the new recommended format. The adjustments you 
mentioned can be addressed in other PRs.


-- 
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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-04-05 Thread via GitHub


winterhazel commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-2039940037

   > @winterhazel, you mentioned in the description that this PR also affects 
quotaStatement and quotaBalance; however, I am not seeing changes in their 
command classes. Could you check?
   
   The changes I mentioned were made in their workflow, not in their command 
classes. 
   
   Regarding `quotaStatement`, the following block has been removed from 
`org.apache.cloudstack.quota.QuotaServiceImpl#getQuotaUsage` to allow providing 
end dates in the future:
   
   ```diff
   -if (endDate.after(_respBldr.startOfNextDay())) {
   -throw new InvalidParameterValueException("Incorrect Date Range. 
End date:" + endDate + " should not be in future. ");
   -}
   ```
   
   The same restriction has been removed for `quotaBalance` in 
`org.apache.cloudstack.quota.QuotaServiceImpl#findQuotaBalanceVO`:
   
   ```diff
   -Date adjustedStartDate = computeAdjustedTime(startDate);
   -if (endDate.after(_respBldr.startOfNextDay())) {
   -throw new InvalidParameterValueException("Incorrect Date 
Range. End date:" + endDate + " should not be in future. ");
   -} else if (startDate.before(endDate)) {
   -Date adjustedEndDate = computeAdjustedTime(endDate);
   +if (startDate.before(endDate)) {
   ```
   
   > Also, I checked the code and observed that both have an odd behavior: they 
take the end date passed as parameters and calculate the next day to it, to use 
it as the end date, instead of using what the caller passed, which means it 
would not retrieve what the caller requested. It would be good to check this 
behavior as well (Adjustment 2).
   
   We can check if this behavior makes sense and, if it does not, change how 
these two APIs use the provided end date; but I think this change starts to get 
out of the scope of this PR, and should be done in a separate one. 
   
   > @winterhazel, you mentioned the API quotaTariffDelete in the PR's 
description; however, I am not seeing changes in its command class. I also 
checked the code and have not found a reason for this API being handled in this 
PR. Was it a typo?
   
   As well as `quotaStatement` and `quotaBalance`, the mentioned change was 
made in the workflow, not in the command class. In 
`org.apache.cloudstack.api.response.QuotaResponseBuilderImpl#deleteQuotaTariff`,
 I made it so that the actual removal date is persisted instead of a 
manipulated one:
   
   ```diff
   -quotaTariff.setRemoved(_quotaService.computeAdjustedTime(new 
Date()));
   +quotaTariff.setRemoved(new Date());
   ```


-- 
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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-04-05 Thread via GitHub


GutoVeronezi commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-2039723185

   @winterhazel dismiss my comments regarding `The response should present the 
data in UTC, not in the server timezone`. I checked other APIs, like 
`listEvents`, and they return the data in the server timezone as well:
   
   ``` 
   (localcloud)  > list events type=USER.LOGIN 
startdate=2024-04-05T09:32:36-0300
   {
 "count": 2,
 "event": [
   {
 "account": "admin",
 "created": "2024-04-05T09:32:36-0300",
 "description": "user has logged in from IP Address /0:0:0:0:0:0:0:1",
 "domain": "ROOT",
 "domainid": "49d58d3c-f09a-11ee-84ff-5254008551cd",
 "id": "3ff56f36-43f6-4843-bd96-52ca0d72f2d0",
 "level": "INFO",
 "resourceid": "5c6bee9b-f09a-11ee-84ff-5254008551cd",
 "resourcename": "admin",
 "resourcetype": "User",
 "state": "Completed",
 "type": "USER.LOGIN",
 "username": "admin"
   },
   {
 "account": "admin",
 "created": "2024-04-05T09:47:42-0300",
 "description": "user has logged in from IP Address /0:0:0:0:0:0:0:1",
 "domain": "ROOT",
 "domainid": "49d58d3c-f09a-11ee-84ff-5254008551cd",
 "id": "8a4fac72-a5a3-427a-8456-05b2f871aef5",
 "level": "INFO",
 "resourceid": "5c6bee9b-f09a-11ee-84ff-5254008551cd",
 "resourcename": "admin",
 "resourcetype": "User",
 "state": "Completed",
 "type": "USER.LOGIN",
 "username": "admin"
   }
 ]
   }
   ```
   
   Perhaps it is something we could discuss in another issue/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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-04-05 Thread via GitHub


GutoVeronezi commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-2039545466

   > quite some q work there @GutoVeronezi ;) would it make sense to split 
this in a series of smaller PRs? cc @winterhazel .
   
   As this PR is quite small in terms of concept and changes, it is easy to 
review. However, there are a few APIs being affected (although, all in the same 
context of normalizing Usage and Quota APIs to consider dates as they were 
informed); thus, the tests are quite extensive. 
   
   Both way would work for me (in terms of reviewing/testing), let's see what 
@winterhazel thinks.


-- 
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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-04-05 Thread via GitHub


DaanHoogland commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-2039121464

   quite some q work there @GutoVeronezi ;) would it make sense to split this 
in a series of smaller PRs? cc @winterhazel .


-- 
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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-04-04 Thread via GitHub


GutoVeronezi commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-2038868041

   @winterhazel @DaanHoogland 
   
   I did some tests with the proposal; following there are some detailed 
descriptions of the tests (hope you guys can find time to read it ) and some 
adjustments that need to be done.
   
   ---
   
   For context: 
   
   - both `usage.aggregation.timezone` and `usage.execution.timezone` are 
configured as `GMT-5`: 
 
![image](https://github.com/apache/cloudstack/assets/38945620/2cc3ce36-17b4-4683-bf30-7cfab8c70903)
   
   - the OS where Management Server and Usage server are running is configured 
with `GMT-3`:
 ```
 root@mgmt:~# date
 Thu Apr  4 10:27:30 PM -03 2024
 ``` 
   
   - the database is in UTC.
   
   ---
   
   
   ## `listUsageRecords`
   
   Following there is the data I worked with.
   
   
   Data
   
   ```sql
   MariaDB [cloud_usage]> select id, account_id, domain_id, description, 
usage_type, raw_usage, start_date, end_date from cloud_usage order by 
usage_type, start_date;
   
+-++---+---++-+-+-+
   | id  | account_id | domain_id | description   | 
usage_type | raw_usage   | start_date  | end_date|
   
+-++---+---++-+-+-+
   |  26 |  2 | 1 | Volume Id: 2 usage time (DiskOffering: 3) | 
 6 | 0.2409972000122 | 2024-04-02 03:00:00 | 2024-04-02 03:59:59 |
   |  27 |  2 | 1 | Volume Id: 1 usage time (DiskOffering: 3) | 
 6 |  0.289465637207 | 2024-04-02 03:00:00 | 2024-04-02 03:59:59 |
   |  29 |  2 | 1 | Volume Id: 2 usage time (DiskOffering: 3) | 
 6 |   1 | 2024-04-02 04:00:00 | 2024-04-02 04:59:59 |
   |  30 |  2 | 1 | Volume Id: 1 usage time (DiskOffering: 3) | 
 6 |   1 | 2024-04-02 04:00:00 | 2024-04-02 04:59:59 |
   |  32 |  2 | 1 | Volume Id: 2 usage time (DiskOffering: 3) | 
 6 |   1 | 2024-04-02 05:00:00 | 2024-04-02 05:59:59 |
   |  33 |  2 | 1 | Volume Id: 1 usage time (DiskOffering: 3) | 
 6 |   1 | 2024-04-02 05:00:00 | 2024-04-02 05:59:59 |
   |  35 |  2 | 1 | Volume Id: 2 usage time (DiskOffering: 3) | 
 6 |   1 | 2024-04-02 06:00:00 | 2024-04-02 06:59:59 |
   |  36 |  2 | 1 | Volume Id: 1 usage time (DiskOffering: 3) | 
 6 |   1 | 2024-04-02 06:00:00 | 2024-04-02 06:59:59 |
   |  38 |  2 | 1 | Volume Id: 2 usage time (DiskOffering: 3) | 
 6 |   1 | 2024-04-02 07:00:00 | 2024-04-02 07:59:59 |
   |  39 |  2 | 1 | Volume Id: 1 usage time (DiskOffering: 3) | 
 6 |   1 | 2024-04-02 07:00:00 | 2024-04-02 07:59:59 |
   |  41 |  2 | 1 | Volume Id: 2 usage time (DiskOffering: 3) | 
 6 |   1 | 2024-04-02 08:00:00 | 2024-04-02 08:59:59 |
   |  42 |  2 | 1 | Volume Id: 1 usage time (DiskOffering: 3) | 
 6 |   1 | 2024-04-02 08:00:00 | 2024-04-02 08:59:59 |
   |  44 |  2 | 1 | Volume Id: 2 usage time (DiskOffering: 3) | 
 6 |   1 | 2024-04-02 09:00:00 | 2024-04-02 09:59:59 |
   |  45 |  2 | 1 | Volume Id: 1 usage time (DiskOffering: 3) | 
 6 |   1 | 2024-04-02 09:00:00 | 2024-04-02 09:59:59 |
   |  47 |  2 | 1 | Volume Id: 2 usage time (DiskOffering: 3) | 
 6 |   1 | 2024-04-02 10:00:00 | 2024-04-02 10:59:59 |
   |  48 |  2 | 1 | Volume Id: 1 usage time (DiskOffering: 3) | 
 6 |   1 | 2024-04-02 10:00:00 | 2024-04-02 10:59:59 |
   |  50 |  2 | 1 | Volume Id: 2 usage time (DiskOffering: 3) | 
 6 |   1 | 2024-04-02 11:00:00 | 2024-04-02 11:59:59 |
   |  51 |  2 | 1 | Volume Id: 1 usage time (DiskOffering: 3) | 
 6 |   1 | 2024-04-02 11:00:00 | 2024-04-02 11:59:59 |
   |  53 |  2 | 1 | Volume Id: 2 usage time (DiskOffering: 3) | 
 6 |   1 | 2024-04-02 12:00:00 | 2024-04-02 12:59:59 |
   |  54 |  2 | 1 | Volume Id: 1 usage time (DiskOffering: 3) | 
 6 |   1 | 2024-04-02 12:00:00 | 2024-04-02 12:59:59 |
   |  56 |  2 | 1 | Volume Id: 2 usage time (DiskOffering: 3) | 
 6 |   1 | 2024-04-02 13:00:00 | 2024-04-02 13:59:59 |
   |  57 |  2 | 1 | Volume Id: 1 usage time (DiskOffering: 3) 

Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-04-04 Thread via GitHub


blueorangutan commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-2037420593

   [SF] Trillian Build Failed (tid-9705)


-- 
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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-04-04 Thread via GitHub


blueorangutan commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-2037377633

   @DaanHoogland a [SL] Trillian-Jenkins test job (alma9 mgmt + kvm-alma9) 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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-04-04 Thread via GitHub


DaanHoogland commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-2037372821

   @blueorangutan test alma9 kvm-alma9


-- 
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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-04-04 Thread via GitHub


blueorangutan commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-2037196523

   Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 9159


-- 
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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-04-04 Thread via GitHub


codecov-commenter commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-2036949004

   ## 
[Codecov](https://app.codecov.io/gh/apache/cloudstack/pull/8243?dropdown=coverage=pr=h1_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache)
 Report
   Attention: Patch coverage is `45.71429%` with `19 lines` in your changes are 
missing coverage. Please review.
   > Project coverage is 31.12%. Comparing base 
[(`ed7389c`)](https://app.codecov.io/gh/apache/cloudstack/commit/ed7389caa38deb02c82989473835d06ad21eb66d?dropdown=coverage=desc_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache)
 to head 
[(`6f5fbfc`)](https://app.codecov.io/gh/apache/cloudstack/pull/8243?dropdown=coverage=pr=desc_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache).
   
   > :exclamation: Current head 6f5fbfc differs from pull request most recent 
head 45c98c7. Consider uploading reports for the commit 45c98c7 to get more 
accurate results
   
   | 
[Files](https://app.codecov.io/gh/apache/cloudstack/pull/8243?dropdown=coverage=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache)
 | Patch % | Lines |
   |---|---|---|
   | 
[...udstack/api/response/QuotaResponseBuilderImpl.java](https://app.codecov.io/gh/apache/cloudstack/pull/8243?src=pr=tree=plugins%2Fdatabase%2Fquota%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fcloudstack%2Fapi%2Fresponse%2FQuotaResponseBuilderImpl.java_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache#diff-cGx1Z2lucy9kYXRhYmFzZS9xdW90YS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvY2xvdWRzdGFjay9hcGkvcmVzcG9uc2UvUXVvdGFSZXNwb25zZUJ1aWxkZXJJbXBsLmphdmE=)
 | 40.00% | [6 Missing :warning: 
](https://app.codecov.io/gh/apache/cloudstack/pull/8243?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache)
 |
   | 
[.../org/apache/cloudstack/quota/QuotaServiceImpl.java](https://app.codecov.io/gh/apache/cloudstack/pull/8243?src=pr=tree=plugins%2Fdatabase%2Fquota%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fcloudstack%2Fquota%2FQuotaServiceImpl.java_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache#diff-cGx1Z2lucy9kYXRhYmFzZS9xdW90YS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvY2xvdWRzdGFjay9xdW90YS9RdW90YVNlcnZpY2VJbXBsLmphdmE=)
 | 50.00% | [4 Missing and 1 partial :warning: 
](https://app.codecov.io/gh/apache/cloudstack/pull/8243?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache)
 |
   | 
[...rc/main/java/com/cloud/usage/UsageServiceImpl.java](https://app.codecov.io/gh/apache/cloudstack/pull/8243?src=pr=tree=server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fcloud%2Fusage%2FUsageServiceImpl.java_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache#diff-c2VydmVyL3NyYy9tYWluL2phdmEvY29tL2Nsb3VkL3VzYWdlL1VzYWdlU2VydmljZUltcGwuamF2YQ==)
 | 0.00% | [5 Missing :warning: 
](https://app.codecov.io/gh/apache/cloudstack/pull/8243?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache)
 |
   | 
[...src/main/java/com/cloud/api/ApiResponseHelper.java](https://app.codecov.io/gh/apache/cloudstack/pull/8243?src=pr=tree=server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fcloud%2Fapi%2FApiResponseHelper.java_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache#diff-c2VydmVyL3NyYy9tYWluL2phdmEvY29tL2Nsb3VkL2FwaS9BcGlSZXNwb25zZUhlbHBlci5qYXZh)
 | 0.00% | [2 Missing :warning: 
](https://app.codecov.io/gh/apache/cloudstack/pull/8243?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache)
 |
   | 
[...e/cloudstack/api/response/QuotaTariffResponse.java](https://app.codecov.io/gh/apache/cloudstack/pull/8243?src=pr=tree=plugins%2Fdatabase%2Fquota%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fcloudstack%2Fapi%2Fresponse%2FQuotaTariffResponse.java_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache#diff-cGx1Z2lucy9kYXRhYmFzZS9xdW90YS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvY2xvdWRzdGFjay9hcGkvcmVzcG9uc2UvUXVvdGFUYXJpZmZSZXNwb25zZS5qYXZh)
 | 50.00% | [1 Missing :warning: 
](https://app.codecov.io/gh/apache/cloudstack/pull/8243?src=pr=tree_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache)
 |
   
   Additional details and impacted files
   
   
   ```diff
   @@ Coverage Diff  @@
   ##   main#8243  +/-   ##
   
   + Coverage 30.72%   31.12%   +0.39% 
   - Complexity3355733933 +376 
   
 Files  5406 5398   -8 
 Lines380310   379509 -801 
 Branches  5553155373 -158 
   
   + Hits 116845   118110+1265 
   + Misses   247903   245745-2158 
   - Partials  1556215654  +92 
   ```
   
   | 

Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-04-04 Thread via GitHub


blueorangutan commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-2036944042

   @winterhazel 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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-04-04 Thread via GitHub


winterhazel commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-2036941899

   @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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-04-01 Thread via GitHub


GutoVeronezi commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-2031091283

   @DaanHoogland @winterhazel 
   While trying to test this one (comparing the results without and with the 
patch), I faced an error with the Usage Server on the branch `main`. I created 
PR #8868 to fix the error; could you guys check? 


-- 
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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-04-01 Thread via GitHub


GutoVeronezi commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-2029615048

   @DaanHoogland 
   I am building it right now to test. Hope I can post my results until the end 
of the day.


-- 
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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-03-29 Thread via GitHub


DaanHoogland commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-2027245770

   @GutoVeronezi did you find time to test 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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-03-25 Thread via GitHub


blueorangutan commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-2019239933

   [SF] Trillian test result (tid-9573)
   Environment: kvm-alma9 (x2), Advanced Networking with Mgmt server a9
   Total time taken: 53169 seconds
   Marvin logs: 
https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr8243-t9573-kvm-alma9.zip
   Smoke tests completed. 129 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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-03-25 Thread via GitHub


blueorangutan commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-2017685047

   @DaanHoogland a [SL] Trillian-Jenkins test job (alma9 mgmt + kvm-alma9) 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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-03-25 Thread via GitHub


DaanHoogland commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-2017683031

   @blueorangutan test alma9 kvm-alma9


-- 
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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-03-21 Thread via GitHub


blueorangutan commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-2014285331

   [SF] Trillian test result (tid-9546)
   Environment: vmware-67u3 (x2), Advanced Networking with Mgmt server r8
   Total time taken: 53930 seconds
   Marvin logs: 
https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr8243-t9546-vmware-67u3.zip
   Smoke tests completed. 129 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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-03-21 Thread via GitHub


blueorangutan commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-2014158132

   [SF] Trillian test result (tid-9547)
   Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 46880 seconds
   Marvin logs: 
https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr8243-t9547-kvm-centos7.zip
   Smoke tests completed. 128 look OK, 1 have errors, 0 did not run
   Only failed and skipped tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_03_secured_to_nonsecured_vm_migration | `Error` | 110.79 | 
test_vm_life_cycle.py
   test_03_secured_to_nonsecured_vm_migration | `Error` | 110.80 | 
test_vm_life_cycle.py
   test_04_nonsecured_to_secured_vm_migration | `Error` | 0.02 | 
test_vm_life_cycle.py
   test_08_migrate_vm | `Error` | 56.63 | test_vm_life_cycle.py
   


-- 
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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-03-21 Thread via GitHub


blueorangutan commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-2014140424

   [SF] Trillian test result (tid-9545)
   Environment: xenserver-71 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 45754 seconds
   Marvin logs: 
https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr8243-t9545-xenserver-71.zip
   Smoke tests completed. 129 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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-03-21 Thread via GitHub


blueorangutan commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-2012103961

   @DaanHoogland a [SL] Trillian-Jenkins matrix job (centos7 mgmt + 
xenserver71, rocky8 mgmt + vmware67u3, centos7 mgmt + kvmcentos7) 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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-03-21 Thread via GitHub


DaanHoogland commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-2012103067

   @blueorangutan test matrix


-- 
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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-03-15 Thread via GitHub


blueorangutan commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-281048

   Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 8953


-- 
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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-03-15 Thread via GitHub


blueorangutan commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-163232

   @DaanHoogland 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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-03-15 Thread via GitHub


DaanHoogland commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-160641

   @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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-03-14 Thread via GitHub


github-actions[bot] commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-1998899277

   This pull request has merge conflicts. Dear author, please fix the conflicts 
and sync your branch with the base branch.


-- 
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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-03-04 Thread via GitHub


github-actions[bot] commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-1976512758

   This pull request has merge conflicts. Dear author, please fix the conflicts 
and sync your branch with the base branch.


-- 
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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-02-13 Thread via GitHub


blueorangutan commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-1942762776

   [SF] Trillian test result (tid-9192)
   Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 43243 seconds
   Marvin logs: 
https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr8243-t9192-kvm-centos7.zip
   Smoke tests completed. 128 look OK, 1 have errors, 0 did not run
   Only failed and skipped tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_02_trigger_shutdown | `Failure` | 341.73 | test_safe_shutdown.py
   


-- 
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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-02-13 Thread via GitHub


blueorangutan commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-1941081590

   @DaanHoogland a [SL] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) 
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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-02-13 Thread via GitHub


DaanHoogland commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-1941077595

   @blueorangutan test


-- 
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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-02-13 Thread via GitHub


blueorangutan commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-1940940175

   Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 8639


-- 
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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-02-13 Thread via GitHub


blueorangutan commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-1940756882

   @DaanHoogland 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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-02-13 Thread via GitHub


DaanHoogland commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-1940753503

   @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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-02-08 Thread via GitHub


github-actions[bot] commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-1934110264

   This pull request has merge conflicts. Dear author, please fix the conflicts 
and sync your branch with the base branch.


-- 
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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-02-06 Thread via GitHub


winterhazel commented on code in PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#discussion_r1480511054


##
plugins/database/quota/src/main/java/org/apache/cloudstack/api/command/QuotaTariffListCmd.java:
##
@@ -46,19 +46,19 @@ public class QuotaTariffListCmd extends BaseListCmd {
 @Parameter(name = ApiConstants.USAGE_TYPE, type = CommandType.INTEGER, 
description = "Usage type of the resource")
 private Integer usageType;
 
-@Parameter(name = ApiConstants.START_DATE, type = CommandType.DATE, 
description = "The start date of the quota tariff. Use -MM-dd as the date 
format, "
-+ "e.g. startDate=2009-06-03.")
+@Parameter(name = ApiConstants.START_DATE, type = CommandType.DATE, 
description = "The start date of the quota tariff. " +
+ApiConstants.PARAMETER_DESCRIPTION_START_DATE_POSSIBLE_FORMATS)
 private Date effectiveDate;
 
-@Parameter(name = ApiConstants.END_DATE, type = CommandType.DATE, 
description = "The end date of the quota tariff. Use -MM-dd as the date 
format, e.g. "
-+ "endDate=2021-11-03.", since = "4.18.0.0")
+@Parameter(name = ApiConstants.END_DATE, type = CommandType.DATE, 
description = "The end date of the quota tariff. " +
+ApiConstants.PARAMETER_DESCRIPTION_END_DATE_POSSIBLE_FORMATS)
 private Date endDate;
 
-@Parameter(name = ApiConstants.NAME, type = CommandType.STRING, 
description = "The name of the quota tariff.", since = "4.18.0.0")
+@Parameter(name = ApiConstants.NAME, type = CommandType.STRING, 
description = "The name of the quota tariff.")

Review Comment:
   Oops, that was unintentional, thanks for noticing it :sweat_smile: 



-- 
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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-02-06 Thread via GitHub


DaanHoogland commented on code in PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#discussion_r1480209735


##
plugins/database/quota/src/main/java/org/apache/cloudstack/api/command/QuotaTariffListCmd.java:
##
@@ -46,19 +46,19 @@ public class QuotaTariffListCmd extends BaseListCmd {
 @Parameter(name = ApiConstants.USAGE_TYPE, type = CommandType.INTEGER, 
description = "Usage type of the resource")
 private Integer usageType;
 
-@Parameter(name = ApiConstants.START_DATE, type = CommandType.DATE, 
description = "The start date of the quota tariff. Use -MM-dd as the date 
format, "
-+ "e.g. startDate=2009-06-03.")
+@Parameter(name = ApiConstants.START_DATE, type = CommandType.DATE, 
description = "The start date of the quota tariff. " +
+ApiConstants.PARAMETER_DESCRIPTION_START_DATE_POSSIBLE_FORMATS)
 private Date effectiveDate;
 
-@Parameter(name = ApiConstants.END_DATE, type = CommandType.DATE, 
description = "The end date of the quota tariff. Use -MM-dd as the date 
format, e.g. "
-+ "endDate=2021-11-03.", since = "4.18.0.0")
+@Parameter(name = ApiConstants.END_DATE, type = CommandType.DATE, 
description = "The end date of the quota tariff. " +
+ApiConstants.PARAMETER_DESCRIPTION_END_DATE_POSSIBLE_FORMATS)

Review Comment:
   good catch by @GutoVeronezi , here as well, please do not remove the since 
attribute of the annotation. It could be helpful to some.



-- 
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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-02-06 Thread via GitHub


GutoVeronezi commented on code in PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#discussion_r1479648472


##
plugins/database/quota/src/main/java/org/apache/cloudstack/api/command/QuotaTariffListCmd.java:
##
@@ -46,19 +46,19 @@ public class QuotaTariffListCmd extends BaseListCmd {
 @Parameter(name = ApiConstants.USAGE_TYPE, type = CommandType.INTEGER, 
description = "Usage type of the resource")
 private Integer usageType;
 
-@Parameter(name = ApiConstants.START_DATE, type = CommandType.DATE, 
description = "The start date of the quota tariff. Use -MM-dd as the date 
format, "
-+ "e.g. startDate=2009-06-03.")
+@Parameter(name = ApiConstants.START_DATE, type = CommandType.DATE, 
description = "The start date of the quota tariff. " +
+ApiConstants.PARAMETER_DESCRIPTION_START_DATE_POSSIBLE_FORMATS)
 private Date effectiveDate;
 
-@Parameter(name = ApiConstants.END_DATE, type = CommandType.DATE, 
description = "The end date of the quota tariff. Use -MM-dd as the date 
format, e.g. "
-+ "endDate=2021-11-03.", since = "4.18.0.0")
+@Parameter(name = ApiConstants.END_DATE, type = CommandType.DATE, 
description = "The end date of the quota tariff. " +
+ApiConstants.PARAMETER_DESCRIPTION_END_DATE_POSSIBLE_FORMATS)
 private Date endDate;
 
-@Parameter(name = ApiConstants.NAME, type = CommandType.STRING, 
description = "The name of the quota tariff.", since = "4.18.0.0")
+@Parameter(name = ApiConstants.NAME, type = CommandType.STRING, 
description = "The name of the quota tariff.")

Review Comment:
   Why remove `since`?



##
plugins/database/quota/src/main/java/org/apache/cloudstack/api/command/QuotaTariffUpdateCmd.java:
##
@@ -52,8 +52,8 @@ public class QuotaTariffUpdateCmd extends BaseCmd {
 "Use -MM-dd as the date format, e.g. startDate=2009-06-03.")
 private Date startDate;
 
-@Parameter(name = ApiConstants.END_DATE, type = CommandType.DATE, 
description = "The end date of the quota tariff. Use -MM-dd as the date 
format, e.g."
-+ " endDate=2009-06-03.", since = "4.18.0.0")
+@Parameter(name = ApiConstants.END_DATE, type = CommandType.DATE, 
description = "The end date of the quota tariff. " +

Review Comment:
   Why remove `since`?



##
plugins/database/quota/src/main/java/org/apache/cloudstack/api/command/QuotaTariffListCmd.java:
##
@@ -46,19 +46,19 @@ public class QuotaTariffListCmd extends BaseListCmd {
 @Parameter(name = ApiConstants.USAGE_TYPE, type = CommandType.INTEGER, 
description = "Usage type of the resource")
 private Integer usageType;
 
-@Parameter(name = ApiConstants.START_DATE, type = CommandType.DATE, 
description = "The start date of the quota tariff. Use -MM-dd as the date 
format, "
-+ "e.g. startDate=2009-06-03.")
+@Parameter(name = ApiConstants.START_DATE, type = CommandType.DATE, 
description = "The start date of the quota tariff. " +
+ApiConstants.PARAMETER_DESCRIPTION_START_DATE_POSSIBLE_FORMATS)
 private Date effectiveDate;
 
-@Parameter(name = ApiConstants.END_DATE, type = CommandType.DATE, 
description = "The end date of the quota tariff. Use -MM-dd as the date 
format, e.g. "
-+ "endDate=2021-11-03.", since = "4.18.0.0")
+@Parameter(name = ApiConstants.END_DATE, type = CommandType.DATE, 
description = "The end date of the quota tariff. " +
+ApiConstants.PARAMETER_DESCRIPTION_END_DATE_POSSIBLE_FORMATS)
 private Date endDate;
 
-@Parameter(name = ApiConstants.NAME, type = CommandType.STRING, 
description = "The name of the quota tariff.", since = "4.18.0.0")
+@Parameter(name = ApiConstants.NAME, type = CommandType.STRING, 
description = "The name of the quota tariff.")
 private String name;
 
-@Parameter(name = ApiConstants.LIST_ALL, type = CommandType.BOOLEAN, 
description = "False will list only not removed quota tariffs. If set to True, 
we will "
-+ "list all, including the removed ones. The default is false.", 
since = "4.18.0.0")
+@Parameter(name = ApiConstants.LIST_ALL, type = CommandType.BOOLEAN, 
description = "False will list only not removed quota tariffs. If set to true, 
we will "

Review Comment:
   Why remove `since`?



-- 
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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-01-24 Thread via GitHub


DaanHoogland commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-1908227425

   @andrijapanicsb I know you have some experience with this, can you comment 
on this change? 


-- 
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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2024-01-23 Thread via GitHub


winterhazel commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-1906806312

   Hey @DaanHoogland, I tried to replicate the scenario you described here, 
with a MS in Singapore (MS and `usage.execution.timezone` set to GMT+8) and a 
DC in Australia (`usage.aggregation.timezone` set to GMT+11), and did some 
tests for this PR. Everything seems to be working as intended; in fact, 
considering dates as they were informed even fixes some issues in this 
scenario. Below are my results.
   
   Some problems I have identified which this PR fixes:
   
   
   
   
   Unable to add credits with quotaCredits
   
   
   
   **Before the changes:**
   
   The time in Singapore was `2024-01-23T00:22:55+0800`. I tried to execute 
`quotaCredits` to add credits to an account:
   
   ```bash
   (admin)  > quota credits account=admin 
domainid=72b54c4a-771d-11ee-8e59-5254003754dc value=5
    Error: (HTTP 431, error code 4350) Incorrect deposit date: Mon Jan 22 
21:22:55 SGT 2024 there are balance entries after this date
   ```
   
   But the MS would not let me add credits to any account, since it incorrectly 
calculated the current date (deposit date) as being 3 hours before the actual 
date, and therefore detected balance entries after it.
   
   **After:**
   
   The time in Singapore was `2024-01-19T21:26:06+0800`. I executed the same 
command:
   
   ```bash
   (admin)  > quota credits account=admin 
domainid=72b54c4a-771d-11ee-8e59-5254003754dc value=5
   {
 "quotacredits": {
   "credits": 5,
   "currency": "$",
   "updated_by": "admin",
   "updated_on": "2024-01-19T21:26:06+0800"
 }
   }
   ```
   
   And was able to successfully add credits to the account.
   
   `updated_on` also had the expected value. Just to ensure that the date was 
indeed correct, I verified it through `quotaBalance`.
   
   ```bash
   (admin)  > quota balance account=admin 
domainid=72b54c4a-771d-11ee-8e59-5254003754dc startdate=2024-01-18 
enddate=2024-01-19
   {
 "balance": {
   "credits": [
 {
   "credits": 5,
   "updated_on": "2024-01-19T21:26:06+0800"
 }
   ],
   "currency": "$",
   "enddate": "2024-01-19T23:59:59+0800",
   "endquota": 5,
   "startdate": "2024-01-18T00:00:00+0800",
   "startquota": 0
 }
   }
   ```
   
   
   
   
   
   
   listUsageRecords does not retrieve the requested data
   
   
   **Before the changes:**
   
   The current time in Australia was `2023-01-23T03:11:26+1100`. I executed the 
command:
   ```bash
   (admin)  > list usagerecords startdate='2024-01-22T19:00:00+1100' 
enddate='2024-01-23T04:00:00+1100'
   ```
   
   ```bash
   2024-01-23 00:11:26,343 DEBUG [c.c.u.UsageServiceImpl] 
(qtp391630194-23:ctx-acf58df9 ctx-d3f654e9) (logid:ba781cb9) getting usage 
records for account: 2, domainId: null, between Mon Jan 22 13:00:00 SGT 2024 
and Mon Jan 22 22:00:00 SGT 2024, using pageSize: 500 and startIndex: 0
   ```
   MS queries for usage records between `2024-01-22T16:00:00+1100` and 
`2024-01-23T01:00:00+1100`, which is not the provided range. I also verified 
that the last returned usage record had the `startdate` of 
`2024-01-23T00:00:00+1100`.
   
   **After the changes:**
   
   The current time in Australia was `2023-01-23T05:10:21+1100`. I executed the 
following command:
   
   ```bash
   (admin)  > list usagerecords startdate='2024-01-22T19:00:00+1100' 
enddate='2024-01-23T07:59:00+1100'
   ```
   
   ```bash
   2024-01-23 02:10:21,078 DEBUG [c.c.u.UsageServiceImpl] 
(qtp391630194-19:ctx-9e97b4a7 ctx-395a7f59) (logid:38101bda) Getting usage 
records for account [2] in domain [null], between [Mon Jan 22 16:00:00 SGT 
2024] and [Tue Jan 23 04:59:00 SGT 2024], using pageSize [500] and startIndex 
[0].
   ```
   
   MS queries for usage records between `2024-01-22T19:00:00+1100` and 
`2024-01-23T07:59:00+1100`, which is the expected range. I also verified that 
the last returned usage record had the `startdate` of 
`2024-01-23T04:00:00+1100` and the `enddate` of `2024-01-23T04:59:59+1100`.
   
   
   
   
   
   
   Wrong dates in quotaTariffCreate
   
   
   **Before:**
   
   ```bash
   (admin)  > quota tariffcreate name="testA" value=2 usagetype=1 
startdate="2024-01-24T01:00:00+1100"
   {
 "quotatariff": {
   "currency": "$",
   "effectiveDate": "2024-01-23T19:00:00+0800",
   "name": "testA",
   "tariffValue": 2,
   "usageDiscriminator": "None",
   "usageName": "RUNNING_VM",
   "usageType": 1,
   "usageTypeDescription": "Running Vm Usage",
   "usageUnit": "Compute*Month",
   "uuid": "b3074921-fd3d-46bd-a5e6-19c445c9a7d8"
 }
   }
   ```
   
   When creating a Quota tariff, `effectiveDate` does not get set to the 
provided `startDate`.
   
   ```bash
   (admin)  > quota tariffcreate name="test2A" value=2 usagetype=1 
startdate="2024-01-25T01:00:00+1100" enddate="2024-01-25T04:00:00+1100"
   {
 "quotatariff": {
   

Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2023-11-17 Thread via GitHub


DaanHoogland commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-1816391644

   > @DaanHoogland the use of the `computeAdjustedTime` causes a lot of 
problems, because the user passes a date parameter to the API, MS converts it 
to a time zone that the final user does not have knowledge, and returns a data 
set that does not match what was requested. As we have the possibility to 
inform the time zone in the parameter (by using the format 
`-MM-dd'T'HH:mm:ssz`), users can request to the API passing the time zone 
they want and will receive a data set that matches what was requested. Also, by 
normalizing everything to UTC (like we do in all the other APIs), the front end 
can easily handle the date to present it in a proper time zone for the final 
user.
   
   @winterhazel @GutoVeronezi , I would like to see extensive testing on this, 
but your explanation makes sense.
   Thank you


-- 
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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2023-11-17 Thread via GitHub


DaanHoogland commented on code in PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#discussion_r1397274718


##
api/src/main/java/org/apache/cloudstack/api/ApiConstants.java:
##
@@ -1088,6 +1088,14 @@ public String toString() {
 }
 }
 
+public static final String 
PARAMETER_DESCRIPTION_START_DATE_POSSIBLE_FORMATS = "The recommended format is 
\"-MM-dd'T'HH:mm:ssZ\" (e.g.: \"2023-01-01T12:00:00+0100\"); " +
+"however, it also accepts the formats \"-MM-dd HH:mm:ss\" 
(e.g.: \"2023-01-01 12:00:00\") and \"-MM-dd\" (e.g.: \"2023-01-01\" - if 
the time is not " +
+"informed, it will be interpreted as \"00:00:00\"). If the 
recommended format is not used, the date will be considered in the server 
timezone.";
+
+public static final String PARAMETER_DESCRIPTION_END_DATE_POSSIBLE_FORMATS 
= "The recommended format is \"-MM-dd'T'HH:mm:ssZ\" (e.g.: 
\"2023-01-01T12:00:00+0100\"); " +
+"however, it also accepts the formats \"-MM-dd HH:mm:ss\" 
(e.g.: \"2023-01-01 12:00:00\") and \"-MM-dd\" (e.g.: \"2023-01-01\" - if 
the time is not " +
+"informed, it will be interpreted as \"23:59:59\"). If the 
recommended format is not used, the date will be considered in the server 
timezone.";

Review Comment:
   ```suggestion
   public static final String 
PARAMETER_DESCRIPTION_END_DATE_POSSIBLE_FORMATS = "The recommended format is 
\"-MM-dd'T'HH:mm:ssZ\" (e.g.: \"2023-01-01T12:00:00+0100\"); " +
   "however, the following formats are also accepted: \"-MM-dd 
HH:mm:ss\" (e.g.: \"2023-01-01 12:00:00\") and \"-MM-dd\" (e.g.: 
\"2023-01-01\" - if the time is not " +
   "added, it will be interpreted as \"23:59:59\"). If the 
recommended format is not used, the date will be considered in the server 
timezone.";
   ```



##
api/src/main/java/org/apache/cloudstack/api/ApiConstants.java:
##
@@ -1088,6 +1088,14 @@ public String toString() {
 }
 }
 
+public static final String 
PARAMETER_DESCRIPTION_START_DATE_POSSIBLE_FORMATS = "The recommended format is 
\"-MM-dd'T'HH:mm:ssZ\" (e.g.: \"2023-01-01T12:00:00+0100\"); " +
+"however, it also accepts the formats \"-MM-dd HH:mm:ss\" 
(e.g.: \"2023-01-01 12:00:00\") and \"-MM-dd\" (e.g.: \"2023-01-01\" - if 
the time is not " +
+"informed, it will be interpreted as \"00:00:00\"). If the 
recommended format is not used, the date will be considered in the server 
timezone.";

Review Comment:
   ```suggestion
   public static final String 
PARAMETER_DESCRIPTION_START_DATE_POSSIBLE_FORMATS = "The recommended format is 
\"-MM-dd'T'HH:mm:ssZ\" (e.g.: \"2023-01-01T12:00:00+0100\"); " +
   "however, the following formats are also accepted: \"-MM-dd 
HH:mm:ss\" (e.g.: \"2023-01-01 12:00:00\") and \"-MM-dd\" (e.g.: 
\"2023-01-01\" - if the time is not " +
   "added, it will be interpreted as \"00:00:00\"). If the 
recommended format is not used, the date will be considered in the server 
timezone.";
   ```



-- 
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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2023-11-17 Thread via GitHub


GutoVeronezi commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-1816241978

   > I'm not so sure we should abandon `private Date computeAdjustedTime(Date 
initialDate, TimeZone targetTZ)`, this will have to be tested in strange 
scenarios. I've seen Cloudstack installations have trouble with a MS in 
Singapore and a DC in Australia. These kinds of situations can actually occur 
within a country easily.
   
   @DaanHoogland the use of the `computeAdjustedTime` causes a lot of problems, 
because the user passes a date parameter to the API, MS converts it to a time 
zone that the final user does not have knowledge, and returns a data set that 
does not match what was requested. As we have the possibility to inform the 
time zone in the parameter (by using the format `-MM-dd'T'HH:mm:ssz`), 
users can request to the API passing the time zone they want and will receive a 
data set that matches what was requested. Also, by normalizing everything to 
UTC (like we do in all the other APIs), the front end can easily handle the 
date to present it in a proper time zone for the final user.


-- 
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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2023-11-16 Thread via GitHub


codecov[bot] commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-1815223730

   ## 
[Codecov](https://app.codecov.io/gh/apache/cloudstack/pull/8243?src=pr=h1_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache)
 Report
   All modified and coverable lines are covered by tests :white_check_mark:
   > Comparison is base 
[(`6001772`)](https://app.codecov.io/gh/apache/cloudstack/commit/60017723357c5c5d3f81931d2b1be286aa986ad8?el=desc_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache)
 29.13% compared to head 
[(`b6b5bc2`)](https://app.codecov.io/gh/apache/cloudstack/pull/8243?src=pr=desc_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache)
 4.49%.
   
   
   Additional details and impacted files
   
   
   ```diff
   @@ Coverage Diff  @@
   ##   main   #8243   +/-   ##
   
   - Coverage 29.13%   4.49%   -24.64% 
   
 Files  5193 354 -4839 
 Lines366232   27905   -338327 
 Branches  535464879-48667 
   
   - Hits 1066921255   -105437 
   + Misses   244918   26512   -218406 
   + Partials  14622 138-14484 
   ```
   
   | 
[Flag](https://app.codecov.io/gh/apache/cloudstack/pull/8243/flags?src=pr=flags_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache)
 | Coverage Δ | |
   |---|---|---|
   | 
[simulator-marvin-tests](https://app.codecov.io/gh/apache/cloudstack/pull/8243/flags?src=pr=flag_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache)
 | `?` | |
   | 
[uitests](https://app.codecov.io/gh/apache/cloudstack/pull/8243/flags?src=pr=flag_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache)
 | `4.49% <ø> (ø)` | |
   | 
[unit-tests](https://app.codecov.io/gh/apache/cloudstack/pull/8243/flags?src=pr=flag_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache)
 | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click 
here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache#carryforward-flags-in-the-pull-request-comment)
 to find out more.
   
   
   
   
   [:umbrella: View full report in Codecov by 
Sentry](https://app.codecov.io/gh/apache/cloudstack/pull/8243?src=pr=continue_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache).
   
   :loudspeaker: Have feedback on the report? [Share it 
here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral_source=github_content=comment_campaign=pr+comments_term=apache).
   


-- 
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-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Normalize dates in Usage and Quota APIs [cloudstack]

2023-11-16 Thread via GitHub


winterhazel commented on PR #8243:
URL: https://github.com/apache/cloudstack/pull/8243#issuecomment-1815213976

   Here is the full response of the `listUsageRecords` API after applying the 
changes. I was not able to include it in the description because it exceeded 
the maximum amount of characters.
   
   
   
   
   Response
   
   
   ```
   (admin)  > list usagerecords startdate='2023-07-20T20:41:22+0200' 
enddate='2023-07-20T18:41:22-0150'
   {
 "count": 68,
 "usagerecord": [
   {
 "account": "system",
 "accountid": "af159ea4-26de-11ec-8dcf-5254005dcdac",
 "description": "Template usage for CentOS 5.5(64-bit) no GUI (KVM) 
(52e1d1a5-26de-11ec-8dcf-5254005dcdac) with size (1.65 GB) 1769537536 and 
virtual size (8.00 GB) 8589934592",
 "domain": "ROOT",
 "domainid": "52d83793-26de-11ec-8dcf-5254005dcdac",
 "enddate": "2023-07-20T19:59:59+",
 "rawusage": "1",
 "size": 1769537536,
 "startdate": "2023-07-20T19:00:00+",
 "tags": [],
 "usage": "1 Hrs",
 "usageid": "52e1d1a5-26de-11ec-8dcf-5254005dcdac",
 "usagetype": 7,
 "virtualsize": 8589934592,
 "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
   },
   {
 "account": "admin",
 "accountid": "af16aaed-26de-11ec-8dcf-5254005dcdac",
 "cpunumber": 1,
 "cpuspeed": 500,
 "description": "Running VM usage for testeApi2 (i-2-179-VM) 
(4ca5b22e-6e8a-4bf1-9819-b980f826f05a) using service offering Small Instance 
(ab647165-7a0a-4984-8452-7bfceb036528) and template Ubuntu Bionic 
(bb4b7b6f-5249-4c18-a5f6-dd886683b702)",
 "domain": "ROOT",
 "domainid": "52d83793-26de-11ec-8dcf-5254005dcdac",
 "enddate": "2023-07-20T19:59:59+",
 "memory": 512,
 "name": "testeApi2",
 "offeringid": "ab647165-7a0a-4984-8452-7bfceb036528",
 "oscategoryid": "52ea89e0-26de-11ec-8dcf-5254005dcdac",
 "oscategoryname": "Ubuntu",
 "osdisplayname": "Ubuntu 18.04 LTS",
 "ostypeid": "681deab8-26de-11ec-8dcf-5254005dcdac",
 "rawusage": "1",
 "startdate": "2023-07-20T19:00:00+",
 "tags": [],
 "templateid": "bb4b7b6f-5249-4c18-a5f6-dd886683b702",
 "type": "KVM",
 "usage": "1 Hrs",
 "usageid": "4ca5b22e-6e8a-4bf1-9819-b980f826f05a",
 "usagetype": 1,
 "virtualmachineid": "4ca5b22e-6e8a-4bf1-9819-b980f826f05a",
 "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
   },
   {
 "account": "admin",
 "accountid": "af16aaed-26de-11ec-8dcf-5254005dcdac",
 "cpunumber": 1,
 "cpuspeed": 500,
 "description": "Running VM usage for testeApi (i-2-177-VM) 
(2e154790-48ea-4923-ba77-7288f01f9c02) using service offering Small Instance 
(ab647165-7a0a-4984-8452-7bfceb036528) and template Ubuntu Bionic 
(bb4b7b6f-5249-4c18-a5f6-dd886683b702)",
 "domain": "ROOT",
 "domainid": "52d83793-26de-11ec-8dcf-5254005dcdac",
 "enddate": "2023-07-20T19:59:59+",
 "memory": 512,
 "name": "testeApi",
 "offeringid": "ab647165-7a0a-4984-8452-7bfceb036528",
 "oscategoryid": "52ea89e0-26de-11ec-8dcf-5254005dcdac",
 "oscategoryname": "Ubuntu",
 "osdisplayname": "Ubuntu 18.04 LTS",
 "ostypeid": "681deab8-26de-11ec-8dcf-5254005dcdac",
 "rawusage": "1",
 "startdate": "2023-07-20T19:00:00+",
 "tags": [],
 "templateid": "bb4b7b6f-5249-4c18-a5f6-dd886683b702",
 "type": "KVM",
 "usage": "1 Hrs",
 "usageid": "2e154790-48ea-4923-ba77-7288f01f9c02",
 "usagetype": 1,
 "virtualmachineid": "2e154790-48ea-4923-ba77-7288f01f9c02",
 "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
   },
   {
 "account": "admin",
 "accountid": "af16aaed-26de-11ec-8dcf-5254005dcdac",
 "cpunumber": 1,
 "cpuspeed": 500,
 "description": "Running VM usage for x (i-2-178-VM) 
(7093969e-fe33-4bd9-977d-41c6b424a927) using service offering Small Instance 
(ab647165-7a0a-4984-8452-7bfceb036528) and template Ubuntu Bionic 
(bb4b7b6f-5249-4c18-a5f6-dd886683b702)",
 "domain": "ROOT",
 "domainid": "52d83793-26de-11ec-8dcf-5254005dcdac",
 "enddate": "2023-07-20T19:59:59+",
 "memory": 512,
 "name": "x",
 "offeringid": "ab647165-7a0a-4984-8452-7bfceb036528",
 "oscategoryid": "52ea89e0-26de-11ec-8dcf-5254005dcdac",
 "oscategoryname": "Ubuntu",
 "osdisplayname": "Ubuntu 18.04 LTS",
 "ostypeid": "681deab8-26de-11ec-8dcf-5254005dcdac",
 "rawusage": "1",
 "startdate": "2023-07-20T19:00:00+",
 "tags": [],
 "templateid": "bb4b7b6f-5249-4c18-a5f6-dd886683b702",
 "type": "KVM",
 "usage": "1 Hrs",
 "usageid": "7093969e-fe33-4bd9-977d-41c6b424a927",