Normalize dates in Usage and Quota APIs

Description
Dates are always stored in GMT in the database. However, when using the Usage and Quota APIs, dates are manipulated according to the configuration usage.aggregation.timezone. Therefore, when informing a date, the user must consider the timezone defined in the configuration and the timezone of the server in order to specify a value. Furthermore, if the configuration and the server are not in the same timezone, ACS will not retrieve the data the user requested.
This PR changes the behavior of Usage and Quota APIs to consider dates as they were informed. Some examples showing how the current date manipulation may yield unexpected results and how this change fixes them can be found in the tests section.
The APIs affected by this change are:

listUsageRecords: the return of this API was also changed to always return the data in GMT, instead of depending on the timezone of the configuration. This way, it complies with the other APIs and allows users to handle the timezone in the frontend;
quotaCredits: when adding credits to an account, the deposit date is now stored in GMT;
quotaBalance: in addition, it is now possible to inform an enddate in the future;
quotaStatement: it is also now possible to inform an enddate in the future;
quotaTariffCreate;
quotaTariffDelete:
quotaTariffList;
quotaTariffUpdate.

With the extension that allows users to inform timezones on APIs that have the date parameter (#7032), it is recommended to inform dates in the format yyyy-MM-dd'T'HH:mm:ssz. When a date is informed in yyyy-MM-dd HH:mm:ss or yyyy-MM-dd, it will be considered that the date was informed in the timezone of the server.
Types of changes

[ ] Breaking change (fix or feature that would cause existing functionality to change)
[ ] New feature (non-breaking change which adds functionality)
[X] Bug fix (non-breaking change which fixes an issue)
[ ] Enhancement (improves an existing feature and functionality)
[ ] Cleanup (Code refactoring and cleanup, that may add test cases)

Feature/Enhancement Scale or Bug Severity
Bug Severity

[ ] BLOCKER
[ ] Critical
[ ] Major
[X] Minor
[ ] Trivial

Screenshots (if appropriate):
How Has This Been Tested?
In a local lab, I defined usage.aggregation.timezone as GMT-3. Then, through CloudMonkey, I verified the behavior of the affected APIs:

listUsageRecords

(admin) 🐱 > list usagerecords startdate='2023-07-20T20:41:22+0200' enddate='2023-07-20T18:41:22-0150'

In this command, startdate is 2023-07-20 18:41:22 in GMT, and the enddate is 2023-07-20 20:31:22.
Current behavior:
2023-09-26 16:30:00,823 DEBUG [c.c.u.UsageServiceImpl] (qtp1955920234-21:ctx-8cc949c0 ctx-b22a8082) (logid:486992ba) getting usage records for account: 2, domainId: null, between Thu Jul 20 21:41:22 UTC 2023 and Thu Jul 20 23:31:22 UTC 2023, using pageSize: 500 and startIndex: 0

The dates get manipulated to 2023-07-20 21:41:22 GMT and 2023-07-20 23:31:22 GMT.
After applying the changes:
2023-09-26 16:26:20,172 DEBUG [c.c.u.UsageServiceImpl] (qtp1955920234-21:ctx-52f71b4c ctx-04cac325) (logid:a95c7352) Getting usage records for account [2] in domain [null], between [Thu Jul 20 18:41:22 UTC 2023] and [Thu Jul 20 20:31:22 UTC 2023], using pageSize [500] and startIndex [0].

The command uses the provided dates converted to GMT.
The full response of this command after applying the patch will be posted as a comment, because including it here made the description exceed the maximum amount of characters.

quotaStatement

(admin) 🐱 > quota statement account=admin domainid=52d83793-26de-11ec-8dcf-5254005dcdac enddate='2023-07-24' startdate='2023-07-24T20:00:00-0300'

The startdate parameter is 2023-07-24 23:00:00 in GMT.
Current behavior:
2023-09-25 20:20:32,008 DEBUG [o.a.c.q.QuotaServiceImpl] (qtp1955920234-21:ctx-a9ea777b ctx-fb4ee927) (logid:359e3d33) Getting quota records for account: 2, domainId: 1, between Tue Jul 25 02:00:00 UTC 2023 and Tue Jul 25 03:00:00 UTC 2023

startdate gets manipulated to 2023-07-25 02:00:00 GMT.
After applying the changes:
2023-09-25 20:17:36,499 DEBUG [o.a.c.q.QuotaServiceImpl] (qtp1955920234-19:ctx-98fcebb7 ctx-d2a8f37f) (logid:6ec97910) Getting quota records of type [null] for account [2] in domain [1], between [Mon Jul 24 23:00:00 UTC 2023] and [Tue Jul 25 00:00:00 UTC 2023].

The command uses the provided startdate in GMT.
Below there is the full response:
(admin) 🐱 > quota statement account=admin domainid=52d83793-26de-11ec-8dcf-5254005dcdac enddate=2023-08-23 startdate=2023-08-21
{
  "statement": {
    "currency": "$",
    "enddate": "2023-08-23T23:59:59+0000",
    "quotausage": [
      {
        "accountid": 2,
        "domain": 1,
        "name": "RUNNING_VM",
        "quota": 0,
        "type": 1,
        "unit": "Compute*Month"
      },
      {
        "accountid": 2,
        "domain": 1,
        "name": "ALLOCATED_VM",
        "quota": 0,
        "type": 2,
        "unit": "Compute*Month"
      },
      {
        "accountid": 2,
        "domain": 1,
        "name": "IP_ADDRESS",
        "quota": 0,
        "type": 3,
        "unit": "IP*Month"
      },
      {
        "accountid": 2,
        "domain": 1,
        "name": "NETWORK_BYTES_SENT",
        "quota": 0,
        "type": 4,
        "unit": "GB"
      },
      {
        "accountid": 2,
        "domain": 1,
        "name": "NETWORK_BYTES_RECEIVED",
        "quota": 0,
        "type": 5,
        "unit": "GB"
      },
      {
        "accountid": 2,
        "domain": 1,
        "name": "VOLUME",
        "quota": 0,
        "type": 6,
        "unit": "GB*Month"
      },
      {
        "accountid": 2,
        "domain": 1,
        "name": "TEMPLATE",
        "quota": 0,
        "type": 7,
        "unit": "GB*Month"
      },
      {
        "accountid": 2,
        "domain": 1,
        "name": "ISO",
        "quota": 0,
        "type": 8,
        "unit": "GB*Month"
      },
      {
        "accountid": 2,
        "domain": 1,
        "name": "SNAPSHOT",
        "quota": 0,
        "type": 9,
        "unit": "GB*Month"
      },
      {
        "accountid": 2,
        "domain": 1,
        "name": "SECURITY_GROUP",
        "quota": 0,
        "type": 10,
        "unit": "Policy*Month"
      },
      {
        "accountid": 2,
        "domain": 1,
        "name": "LOAD_BALANCER_POLICY",
        "quota": 0,
        "type": 11,
        "unit": "Policy*Month"
      },
      {
        "accountid": 2,
        "domain": 1,
        "name": "PORT_FORWARDING_RULE",
        "quota": 0,
        "type": 12,
        "unit": "Policy*Month"
      },
      {
        "accountid": 2,
        "domain": 1,
        "name": "NETWORK_OFFERING",
        "quota": 0,
        "type": 13,
        "unit": "Policy*Month"
      },
      {
        "accountid": 2,
        "domain": 1,
        "name": "VPN_USERS",
        "quota": 0,
        "type": 14,
        "unit": "Policy*Month"
      },
      {
        "accountid": 2,
        "domain": 1,
        "name": "VM_DISK_IO_READ",
        "quota": 0,
        "type": 21,
        "unit": "IOPS"
      },
      {
        "accountid": 2,
        "domain": 1,
        "name": "VM_DISK_IO_WRITE",
        "quota": 0,
        "type": 22,
        "unit": "IOPS"
      },
      {
        "accountid": 2,
        "domain": 1,
        "name": "VM_DISK_BYTES_READ",
        "quota": 0,
        "type": 23,
        "unit": "Bytes"
      },
      {
        "accountid": 2,
        "domain": 1,
        "name": "VM_DISK_BYTES_WRITE",
        "quota": 0,
        "type": 24,
        "unit": "Bytes"
      },
      {
        "accountid": 2,
        "domain": 1,
        "name": "VM_SNAPSHOT",
        "quota": 0,
        "type": 25,
        "unit": "GB*Month"
      },
      {
        "accountid": 2,
        "domain": 1,
        "name": "VOLUME_SECONDARY",
        "quota": 0,
        "type": 26,
        "unit": "GB*Month"
      },
      {
        "accountid": 2,
        "domain": 1,
        "name": "VM_SNAPSHOT_ON_PRIMARY",
        "quota": 0,
        "type": 27,
        "unit": "GB*Month"
      },
      {
        "accountid": 2,
        "domain": 1,
        "name": "BACKUP",
        "quota": 0,
        "type": 28,
        "unit": "GB*Month"
      }
    ],
    "startdate": "2023-08-21T00:00:00+0000",
    "totalquota": 0
  }
}

quotaCredits and quotaBalance

Current behavior:
(admin) 🐱 > quota credits account=admin domainid=52d83793-26de-11ec-8dcf-5254005dcdac value=5
{
  "quotacredits": {
    "credits": 5,
    "currency": "$",
    "updated_by": "admin",
    "updated_on": "2023-09-25T19:33:33+0000"
  }
}

(admin) 🐱 > quota balance account=admin domainid=52d83793-26de-11ec-8dcf-5254005dcdac startdate=2023-09-23 enddate=2023-09-25
{
  "balance": {
    "credits": [
      {
        "credits": 5,
        "updated_on": "2023-09-25T22:33:32+0000"
      }
    ],
    "currency": "$",
    "enddate": "2023-09-25T23:59:59+0000",
    "endquota": 5,
    "startdate": "2023-09-23T00:00:00+0000",
    "startquota": 0
  }
}

The time in GMT was 2023-09-25 19:33:33, but updated_on was stored as 2023-09-25 22:33:32 in the database.
After applying the changes:
(admin) 🐱 > quota credits account=admin domainid=52d83793-26de-11ec-8dcf-5254005dcdac value=5
{
  "quotacredits": {
    "credits": 5,
    "currency": "$",
    "updated_by": "admin",
    "updated_on": "2023-09-26T16:15:35+0000"
  }
}

(admin) 🐱 > quota balance account=admin domainid=52d83793-26de-11ec-8dcf-5254005dcdac startdate=2023-09-25 enddate=2023-09-26
{
  "balance": {
    "credits": [
      {
        "credits": 5,
        "updated_on": "2023-09-26T16:15:35+0000"
      }
    ],
    "currency": "$",
    "enddate": "2023-09-26T23:59:59+0000",
    "endquota": 5,
    "startdate": "2023-09-25T00:00:00+0000",
    "startquota": 0
  }
}

The time in GMT was 2023-09-26 16:15:35, and the correct value of 2023-09-26 16:15:35 was stored in the database.

quotaTariffCreate

After applying the changes:
(admin) 🐱 > quota tariffcreate name="teste" value=2 usagetype=1 startdate="2023-09-27T23:00:00-0300"
{
  "quotatariff": {
    "currency": "$",
    "effectiveDate": "2023-09-28T02:00:00+0000",
    "id": "327f84d1-1506-4366-8755-c4042057a93f",
    "name": "teste",
    "tariffValue": 2,
    "usageDiscriminator": "None",
    "usageName": "RUNNING_VM",
    "usageType": 1,
    "usageTypeDescription": "Running Vm Usage",
    "usageUnit": "Compute*Month"
  }
}

(admin) 🐱 > quota tariffcreate name="teste2" value=2 usagetype=1 startdate="2023-09-30T23:00:00+0000" enddate="2023-10-02T14:00:00+0000"
{
  "quotatariff": {
    "currency": "$",
    "effectiveDate": "2023-09-30T23:00:00+0000",
    "endDate": "2023-10-02T14:00:00+0000",
    "id": "962feae6-7947-45bb-8d55-ca9e90dcf6e2",
    "name": "teste2",
    "tariffValue": 2,
    "usageDiscriminator": "None",
    "usageName": "RUNNING_VM",
    "usageType": 1,
    "usageTypeDescription": "Running Vm Usage",
    "usageUnit": "Compute*Month"
  }
}

quotaTariffUpdate

After applying the changes:
(admin) 🐱 > quota tariffupdate name=teste enddate=2023-09-29
{
  "quotatariff": {
    "currency": "$",
    "effectiveDate": "2023-09-28T02:00:00+0000",
    "endDate": "2023-09-29T23:59:59+0000",
    "id": "c2788963-26ae-4a2a-b955-8123c353b517",
    "name": "teste",
    "tariffValue": 2,
    "usageDiscriminator": "None",
    "usageName": "RUNNING_VM",
    "usageType": 1,
    "usageTypeDescription": "Running Vm Usage",
    "usageUnit": "Compute*Month"
  }
}

quotaTariffList

After applying the changes:
(admin) 🐱 > quota tarifflist startdate='2023-09-24T01:00:00+0000' enddate=2023-10-03
{
  "count": 2,
  "quotatariff": [
    {
      "currency": "$",
      "effectiveDate": "2023-09-30T23:00:00+0000",
      "endDate": "2023-10-02T14:00:00+0000",
      "id": "962feae6-7947-45bb-8d55-ca9e90dcf6e2",
      "name": "teste2",
      "tariffValue": 2,
      "usageDiscriminator": "None",
      "usageName": "RUNNING_VM",
      "usageType": 1,
      "usageTypeDescription": "Running Vm Usage",
      "usageUnit": "Compute*Month"
    },
    {
      "currency": "$",
      "effectiveDate": "2023-09-28T02:00:00+0000",
      "endDate": "2023-09-29T23:59:59+0000",
      "id": "c2788963-26ae-4a2a-b955-8123c353b517",
      "name": "teste",
      "tariffValue": 2,
      "usageDiscriminator": "None",
      "usageName": "RUNNING_VM",
      "usageType": 1,
      "usageTypeDescription": "Running Vm Usage",
      "usageUnit": "Compute*Month"
    }
  ]
}

(admin) 🐱 > quota tarifflist startdate='2023-09-29T01:00:00-0300' enddate=2023-10-03
{
  "count": 1,
  "quotatariff": [
    {
      "currency": "$",
      "effectiveDate": "2023-09-30T23:00:00+0000",
      "endDate": "2023-10-02T14:00:00+0000",
      "id": "962feae6-7947-45bb-8d55-ca9e90dcf6e2",
      "name": "teste2",
      "tariffValue": 2,
      "usageDiscriminator": "None",
      "usageName": "RUNNING_VM",
      "usageType": 1,
      "usageTypeDescription": "Running Vm Usage",
      "usageUnit": "Compute*Month"
    }
  ]
}

quotaTariffDelete

After applying the changes:
(admin) 🐱 > quota tariffdelete id=962feae6-7947-45bb-8d55-ca9e90dcf6e2
{
  "success": true
}

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)<PHONE_NUMBER> and virtual size (8.00 GB)<PHONE_NUMBER>",
      "domain": "ROOT",
      "domainid": "52d83793-26de-11ec-8dcf-5254005dcdac",
      "enddate": "2023-07-20T19:59:59+0000",
      "rawusage": "1",
      "size":<PHONE_NUMBER>,
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "usage": "1 Hrs",
      "usageid": "52e1d1a5-26de-11ec-8dcf-5254005dcdac",
      "usagetype": 7,
      "virtualsize":<PHONE_NUMBER>,
      "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+0000",
      "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+0000",
      "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+0000",
      "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+0000",
      "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+0000",
      "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+0000",
      "tags": [],
      "templateid": "bb4b7b6f-5249-4c18-a5f6-dd886683b702",
      "type": "KVM",
      "usage": "1 Hrs",
      "usageid": "7093969e-fe33-4bd9-977d-41c6b424a927",
      "usagetype": 1,
      "virtualmachineid": "7093969e-fe33-4bd9-977d-41c6b424a927",
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "admin",
      "accountid": "af16aaed-26de-11ec-8dcf-5254005dcdac",
      "cpunumber": 1,
      "cpuspeed": 500,
      "description": "Running VM usage for sem2 (i-2-175-VM) (639fa094-13c5-4e4f-99d3-5c2727710f96) 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+0000",
      "memory": 512,
      "name": "sem2",
      "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+0000",
      "tags": [],
      "templateid": "bb4b7b6f-5249-4c18-a5f6-dd886683b702",
      "type": "KVM",
      "usage": "1 Hrs",
      "usageid": "639fa094-13c5-4e4f-99d3-5c2727710f96",
      "usagetype": 1,
      "virtualmachineid": "639fa094-13c5-4e4f-99d3-5c2727710f96",
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "admin",
      "accountid": "af16aaed-26de-11ec-8dcf-5254005dcdac",
      "cpunumber": 1,
      "cpuspeed": 500,
      "description": "Running VM usage for VM-445c705c-5c89-491c-a791-431417c8a9a4 (i-2-174-VM) (445c705c-5c89-491c-a791-431417c8a9a4) 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+0000",
      "memory": 512,
      "name": "VM-445c705c-5c89-491c-a791-431417c8a9a4",
      "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+0000",
      "tags": [],
      "templateid": "bb4b7b6f-5249-4c18-a5f6-dd886683b702",
      "type": "KVM",
      "usage": "1 Hrs",
      "usageid": "445c705c-5c89-491c-a791-431417c8a9a4",
      "usagetype": 1,
      "virtualmachineid": "445c705c-5c89-491c-a791-431417c8a9a4",
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "admin",
      "accountid": "af16aaed-26de-11ec-8dcf-5254005dcdac",
      "cpunumber": 1,
      "cpuspeed": 500,
      "description": "Running VM usage for VM-73680a37-cdb1-4860-91b3-268ba7d31b76 (i-2-182-VM) (73680a37-cdb1-4860-91b3-268ba7d31b76) using service offering Small Instance (ab647165-7a0a-4984-8452-7bfceb036528) and template CentOS 5.5(64-bit) no GUI (KVM) (52e1d1a5-26de-11ec-8dcf-5254005dcdac)",
      "domain": "ROOT",
      "domainid": "52d83793-26de-11ec-8dcf-5254005dcdac",
      "enddate": "2023-07-20T19:59:59+0000",
      "memory": 512,
      "name": "VM-73680a37-cdb1-4860-91b3-268ba7d31b76",
      "offeringid": "ab647165-7a0a-4984-8452-7bfceb036528",
      "oscategoryid": "52e48fdf-26de-11ec-8dcf-5254005dcdac",
      "oscategoryname": "CentOS",
      "osdisplayname": "CentOS 5.5 (64-bit)",
      "ostypeid": "5323a328-26de-11ec-8dcf-5254005dcdac",
      "rawusage": "1",
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "templateid": "52e1d1a5-26de-11ec-8dcf-5254005dcdac",
      "type": "KVM",
      "usage": "1 Hrs",
      "usageid": "73680a37-cdb1-4860-91b3-268ba7d31b76",
      "usagetype": 1,
      "virtualmachineid": "73680a37-cdb1-4860-91b3-268ba7d31b76",
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "admin",
      "accountid": "af16aaed-26de-11ec-8dcf-5254005dcdac",
      "cpunumber": 1,
      "cpuspeed": 500,
      "description": "Running VM usage for VM-3d0a5c66-676a-4458-8c4d-ca74ad2d1a63 (i-2-183-VM) (3d0a5c66-676a-4458-8c4d-ca74ad2d1a63) using service offering Small Instance (ab647165-7a0a-4984-8452-7bfceb036528) and template CentOS 5.5(64-bit) no GUI (KVM) (52e1d1a5-26de-11ec-8dcf-5254005dcdac)",
      "domain": "ROOT",
      "domainid": "52d83793-26de-11ec-8dcf-5254005dcdac",
      "enddate": "2023-07-20T19:59:59+0000",
      "memory": 512,
      "name": "VM-3d0a5c66-676a-4458-8c4d-ca74ad2d1a63",
      "offeringid": "ab647165-7a0a-4984-8452-7bfceb036528",
      "oscategoryid": "52e48fdf-26de-11ec-8dcf-5254005dcdac",
      "oscategoryname": "CentOS",
      "osdisplayname": "CentOS 5.5 (64-bit)",
      "ostypeid": "5323a328-26de-11ec-8dcf-5254005dcdac",
      "rawusage": "1",
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "templateid": "52e1d1a5-26de-11ec-8dcf-5254005dcdac",
      "type": "KVM",
      "usage": "1 Hrs",
      "usageid": "3d0a5c66-676a-4458-8c4d-ca74ad2d1a63",
      "usagetype": 1,
      "virtualmachineid": "3d0a5c66-676a-4458-8c4d-ca74ad2d1a63",
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "admin",
      "accountid": "af16aaed-26de-11ec-8dcf-5254005dcdac",
      "cpunumber": 1,
      "cpuspeed": 500,
      "description": "Running VM usage for testeApi3 (i-2-180-VM) (e595a667-9b3d-4e24-9383-3e69fc3f3c56) 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+0000",
      "memory": 512,
      "name": "testeApi3",
      "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+0000",
      "tags": [],
      "templateid": "bb4b7b6f-5249-4c18-a5f6-dd886683b702",
      "type": "KVM",
      "usage": "1 Hrs",
      "usageid": "e595a667-9b3d-4e24-9383-3e69fc3f3c56",
      "usagetype": 1,
      "virtualmachineid": "e595a667-9b3d-4e24-9383-3e69fc3f3c56",
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "admin",
      "accountid": "af16aaed-26de-11ec-8dcf-5254005dcdac",
      "cpunumber": 1,
      "cpuspeed": 500,
      "description": "Allocated 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+0000",
      "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+0000",
      "tags": [],
      "templateid": "bb4b7b6f-5249-4c18-a5f6-dd886683b702",
      "type": "KVM",
      "usage": "1 Hrs",
      "usageid": "7093969e-fe33-4bd9-977d-41c6b424a927",
      "usagetype": 2,
      "virtualmachineid": "7093969e-fe33-4bd9-977d-41c6b424a927",
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "admin",
      "accountid": "af16aaed-26de-11ec-8dcf-5254005dcdac",
      "cpunumber": 1,
      "cpuspeed": 500,
      "description": "Allocated 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+0000",
      "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+0000",
      "tags": [],
      "templateid": "bb4b7b6f-5249-4c18-a5f6-dd886683b702",
      "type": "KVM",
      "usage": "1 Hrs",
      "usageid": "4ca5b22e-6e8a-4bf1-9819-b980f826f05a",
      "usagetype": 2,
      "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": "Allocated 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+0000",
      "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+0000",
      "tags": [],
      "templateid": "bb4b7b6f-5249-4c18-a5f6-dd886683b702",
      "type": "KVM",
      "usage": "1 Hrs",
      "usageid": "2e154790-48ea-4923-ba77-7288f01f9c02",
      "usagetype": 2,
      "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": "Allocated VM usage for VM-445c705c-5c89-491c-a791-431417c8a9a4 (i-2-174-VM) (445c705c-5c89-491c-a791-431417c8a9a4) 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+0000",
      "memory": 512,
      "name": "VM-445c705c-5c89-491c-a791-431417c8a9a4",
      "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+0000",
      "tags": [],
      "templateid": "bb4b7b6f-5249-4c18-a5f6-dd886683b702",
      "type": "KVM",
      "usage": "1 Hrs",
      "usageid": "445c705c-5c89-491c-a791-431417c8a9a4",
      "usagetype": 2,
      "virtualmachineid": "445c705c-5c89-491c-a791-431417c8a9a4",
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "admin",
      "accountid": "af16aaed-26de-11ec-8dcf-5254005dcdac",
      "cpunumber": 1,
      "cpuspeed": 500,
      "description": "Allocated VM usage for sem2 (i-2-175-VM) (639fa094-13c5-4e4f-99d3-5c2727710f96) 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+0000",
      "memory": 512,
      "name": "sem2",
      "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+0000",
      "tags": [],
      "templateid": "bb4b7b6f-5249-4c18-a5f6-dd886683b702",
      "type": "KVM",
      "usage": "1 Hrs",
      "usageid": "639fa094-13c5-4e4f-99d3-5c2727710f96",
      "usagetype": 2,
      "virtualmachineid": "639fa094-13c5-4e4f-99d3-5c2727710f96",
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "admin",
      "accountid": "af16aaed-26de-11ec-8dcf-5254005dcdac",
      "cpunumber": 1,
      "cpuspeed": 500,
      "description": "Allocated VM usage for VM-3d0a5c66-676a-4458-8c4d-ca74ad2d1a63 (i-2-183-VM) (3d0a5c66-676a-4458-8c4d-ca74ad2d1a63) using service offering Small Instance (ab647165-7a0a-4984-8452-7bfceb036528) and template CentOS 5.5(64-bit) no GUI (KVM) (52e1d1a5-26de-11ec-8dcf-5254005dcdac)",
      "domain": "ROOT",
      "domainid": "52d83793-26de-11ec-8dcf-5254005dcdac",
      "enddate": "2023-07-20T19:59:59+0000",
      "memory": 512,
      "name": "VM-3d0a5c66-676a-4458-8c4d-ca74ad2d1a63",
      "offeringid": "ab647165-7a0a-4984-8452-7bfceb036528",
      "oscategoryid": "52e48fdf-26de-11ec-8dcf-5254005dcdac",
      "oscategoryname": "CentOS",
      "osdisplayname": "CentOS 5.5 (64-bit)",
      "ostypeid": "5323a328-26de-11ec-8dcf-5254005dcdac",
      "rawusage": "1",
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "templateid": "52e1d1a5-26de-11ec-8dcf-5254005dcdac",
      "type": "KVM",
      "usage": "1 Hrs",
      "usageid": "3d0a5c66-676a-4458-8c4d-ca74ad2d1a63",
      "usagetype": 2,
      "virtualmachineid": "3d0a5c66-676a-4458-8c4d-ca74ad2d1a63",
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "admin",
      "accountid": "af16aaed-26de-11ec-8dcf-5254005dcdac",
      "cpunumber": 1,
      "cpuspeed": 500,
      "description": "Allocated VM usage for VM-73680a37-cdb1-4860-91b3-268ba7d31b76 (i-2-182-VM) (73680a37-cdb1-4860-91b3-268ba7d31b76) using service offering Small Instance (ab647165-7a0a-4984-8452-7bfceb036528) and template CentOS 5.5(64-bit) no GUI (KVM) (52e1d1a5-26de-11ec-8dcf-5254005dcdac)",
      "domain": "ROOT",
      "domainid": "52d83793-26de-11ec-8dcf-5254005dcdac",
      "enddate": "2023-07-20T19:59:59+0000",
      "memory": 512,
      "name": "VM-73680a37-cdb1-4860-91b3-268ba7d31b76",
      "offeringid": "ab647165-7a0a-4984-8452-7bfceb036528",
      "oscategoryid": "52e48fdf-26de-11ec-8dcf-5254005dcdac",
      "oscategoryname": "CentOS",
      "osdisplayname": "CentOS 5.5 (64-bit)",
      "ostypeid": "5323a328-26de-11ec-8dcf-5254005dcdac",
      "rawusage": "1",
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "templateid": "52e1d1a5-26de-11ec-8dcf-5254005dcdac",
      "type": "KVM",
      "usage": "1 Hrs",
      "usageid": "73680a37-cdb1-4860-91b3-268ba7d31b76",
      "usagetype": 2,
      "virtualmachineid": "73680a37-cdb1-4860-91b3-268ba7d31b76",
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "admin",
      "accountid": "af16aaed-26de-11ec-8dcf-5254005dcdac",
      "cpunumber": 1,
      "cpuspeed": 500,
      "description": "Allocated VM usage for testeApi3 (i-2-180-VM) (e595a667-9b3d-4e24-9383-3e69fc3f3c56) 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+0000",
      "memory": 512,
      "name": "testeApi3",
      "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+0000",
      "tags": [],
      "templateid": "bb4b7b6f-5249-4c18-a5f6-dd886683b702",
      "type": "KVM",
      "usage": "1 Hrs",
      "usageid": "e595a667-9b3d-4e24-9383-3e69fc3f3c56",
      "usagetype": 2,
      "virtualmachineid": "e595a667-9b3d-4e24-9383-3e69fc3f3c56",
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "admin",
      "accountid": "af16aaed-26de-11ec-8dcf-5254005dcdac",
      "description": "Volume usage for ROOT-177 (b772a760-20ff-4a5b-9f36-ac574a0e5598) and template Ubuntu Bionic (bb4b7b6f-5249-4c18-a5f6-dd886683b702) and size (8.00 GB)<PHONE_NUMBER>",
      "domain": "ROOT",
      "domainid": "52d83793-26de-11ec-8dcf-5254005dcdac",
      "enddate": "2023-07-20T19:59:59+0000",
      "rawusage": "1",
      "size":<PHONE_NUMBER>,
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "templateid": "bb4b7b6f-5249-4c18-a5f6-dd886683b702",
      "usage": "1 Hrs",
      "usageid": "b772a760-20ff-4a5b-9f36-ac574a0e5598",
      "usagetype": 6,
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "admin",
      "accountid": "af16aaed-26de-11ec-8dcf-5254005dcdac",
      "description": "Volume usage for x (c4f6758a-9ea9-4ff7-adb5-dbe01cd497bd) with disk offering Medium (bb9abd10-e445-4edd-a109-46eacde15793) and size (20.00 GB)<PHONE_NUMBER>0",
      "domain": "ROOT",
      "domainid": "52d83793-26de-11ec-8dcf-5254005dcdac",
      "enddate": "2023-07-20T19:59:59+0000",
      "offeringid": "bb9abd10-e445-4edd-a109-46eacde15793",
      "rawusage": "1",
      "size":<PHONE_NUMBER>0,
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "usage": "1 Hrs",
      "usageid": "c4f6758a-9ea9-4ff7-adb5-dbe01cd497bd",
      "usagetype": 6,
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "admin",
      "accountid": "af16aaed-26de-11ec-8dcf-5254005dcdac",
      "description": "Volume usage for ROOT-182 (801de6c3-dc9b-4061-8eb7-bf39a30a8eda) and template CentOS 5.5(64-bit) no GUI (KVM) (52e1d1a5-26de-11ec-8dcf-5254005dcdac) and size (8.00 GB)<PHONE_NUMBER>",
      "domain": "ROOT",
      "domainid": "52d83793-26de-11ec-8dcf-5254005dcdac",
      "enddate": "2023-07-20T19:59:59+0000",
      "rawusage": "1",
      "size":<PHONE_NUMBER>,
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "templateid": "52e1d1a5-26de-11ec-8dcf-5254005dcdac",
      "usage": "1 Hrs",
      "usageid": "801de6c3-dc9b-4061-8eb7-bf39a30a8eda",
      "usagetype": 6,
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "admin",
      "accountid": "af16aaed-26de-11ec-8dcf-5254005dcdac",
      "description": "Volume usage for ROOT-1361 (a4f978bb-24a1-459d-b549-45a7089d2f2b) and template CentOS 5.5(64-bit) no GUI (KVM) (52e1d1a5-26de-11ec-8dcf-5254005dcdac) and size (8.00 GB)<PHONE_NUMBER>",
      "domain": "ROOT",
      "domainid": "52d83793-26de-11ec-8dcf-5254005dcdac",
      "enddate": "2023-07-20T19:59:59+0000",
      "rawusage": "1",
      "size":<PHONE_NUMBER>,
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "templateid": "52e1d1a5-26de-11ec-8dcf-5254005dcdac",
      "usage": "1 Hrs",
      "usageid": "a4f978bb-24a1-459d-b549-45a7089d2f2b",
      "usagetype": 6,
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "admin",
      "accountid": "af16aaed-26de-11ec-8dcf-5254005dcdac",
      "description": "Volume usage for ROOT-183 (4cb81d5c-4366-4b58-8c95-3e6d8ac31095) and template CentOS 5.5(64-bit) no GUI (KVM) (52e1d1a5-26de-11ec-8dcf-5254005dcdac) and size (8.00 GB)<PHONE_NUMBER>",
      "domain": "ROOT",
      "domainid": "52d83793-26de-11ec-8dcf-5254005dcdac",
      "enddate": "2023-07-20T19:59:59+0000",
      "rawusage": "1",
      "size":<PHONE_NUMBER>,
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "templateid": "52e1d1a5-26de-11ec-8dcf-5254005dcdac",
      "usage": "1 Hrs",
      "usageid": "4cb81d5c-4366-4b58-8c95-3e6d8ac31095",
      "usagetype": 6,
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "admin",
      "accountid": "af16aaed-26de-11ec-8dcf-5254005dcdac",
      "description": "Volume usage for ROOT-175 (eb2f1450-0dee-4a1b-baf0-90f353c2d7af) and template Ubuntu Bionic (bb4b7b6f-5249-4c18-a5f6-dd886683b702) and size (8.00 GB)<PHONE_NUMBER>",
      "domain": "ROOT",
      "domainid": "52d83793-26de-11ec-8dcf-5254005dcdac",
      "enddate": "2023-07-20T19:59:59+0000",
      "rawusage": "1",
      "size":<PHONE_NUMBER>,
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "templateid": "bb4b7b6f-5249-4c18-a5f6-dd886683b702",
      "usage": "1 Hrs",
      "usageid": "eb2f1450-0dee-4a1b-baf0-90f353c2d7af",
      "usagetype": 6,
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "admin",
      "accountid": "af16aaed-26de-11ec-8dcf-5254005dcdac",
      "description": "Volume usage for ROOT-179 (cc8672a7-92d4-4ef7-bb9c-86742ee60e9b) and template Ubuntu Bionic (bb4b7b6f-5249-4c18-a5f6-dd886683b702) and size (8.00 GB)<PHONE_NUMBER>",
      "domain": "ROOT",
      "domainid": "52d83793-26de-11ec-8dcf-5254005dcdac",
      "enddate": "2023-07-20T19:59:59+0000",
      "rawusage": "1",
      "size":<PHONE_NUMBER>,
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "templateid": "bb4b7b6f-5249-4c18-a5f6-dd886683b702",
      "usage": "1 Hrs",
      "usageid": "cc8672a7-92d4-4ef7-bb9c-86742ee60e9b",
      "usagetype": 6,
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "admin",
      "accountid": "af16aaed-26de-11ec-8dcf-5254005dcdac",
      "description": "Volume usage for ROOT-99 (null) and template Vol B (7aa19f28-86d6-44bc-905a-6a6768e44306) and size (8.00 GB)<PHONE_NUMBER>",
      "domain": "ROOT",
      "domainid": "52d83793-26de-11ec-8dcf-5254005dcdac",
      "enddate": "2023-07-20T19:59:59+0000",
      "rawusage": "1",
      "size":<PHONE_NUMBER>,
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "templateid": "7aa19f28-86d6-44bc-905a-6a6768e44306",
      "usage": "1 Hrs",
      "usagetype": 6,
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "admin",
      "accountid": "af16aaed-26de-11ec-8dcf-5254005dcdac",
      "description": "Volume usage for ROOT-96 (null) and template Ubuntu Bionic (bb4b7b6f-5249-4c18-a5f6-dd886683b702) and size (8.00 GB)<PHONE_NUMBER>",
      "domain": "ROOT",
      "domainid": "52d83793-26de-11ec-8dcf-5254005dcdac",
      "enddate": "2023-07-20T19:59:59+0000",
      "rawusage": "1",
      "size":<PHONE_NUMBER>,
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "templateid": "bb4b7b6f-5249-4c18-a5f6-dd886683b702",
      "usage": "1 Hrs",
      "usagetype": 6,
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "admin",
      "accountid": "af16aaed-26de-11ec-8dcf-5254005dcdac",
      "description": "Volume usage for ROOT-178 (f0d3ee40-32ba-4f18-8ac6-842a1c9a97b8) and template Ubuntu Bionic (bb4b7b6f-5249-4c18-a5f6-dd886683b702) and size (8.00 GB)<PHONE_NUMBER>",
      "domain": "ROOT",
      "domainid": "52d83793-26de-11ec-8dcf-5254005dcdac",
      "enddate": "2023-07-20T19:59:59+0000",
      "rawusage": "1",
      "size":<PHONE_NUMBER>,
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "templateid": "bb4b7b6f-5249-4c18-a5f6-dd886683b702",
      "usage": "1 Hrs",
      "usageid": "f0d3ee40-32ba-4f18-8ac6-842a1c9a97b8",
      "usagetype": 6,
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "admin",
      "accountid": "af16aaed-26de-11ec-8dcf-5254005dcdac",
      "description": "Volume usage for ROOT-174 (8d002b26-e7df-4f6f-b0d6-7a6b2bb1bd2c) and template Ubuntu Bionic (bb4b7b6f-5249-4c18-a5f6-dd886683b702) and size (8.00 GB)<PHONE_NUMBER>",
      "domain": "ROOT",
      "domainid": "52d83793-26de-11ec-8dcf-5254005dcdac",
      "enddate": "2023-07-20T19:59:59+0000",
      "rawusage": "1",
      "size":<PHONE_NUMBER>,
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "templateid": "bb4b7b6f-5249-4c18-a5f6-dd886683b702",
      "usage": "1 Hrs",
      "usageid": "8d002b26-e7df-4f6f-b0d6-7a6b2bb1bd2c",
      "usagetype": 6,
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "admin",
      "accountid": "af16aaed-26de-11ec-8dcf-5254005dcdac",
      "description": "Volume usage for 8656f21b-e10d-4637-a82d-69d854760df2 (976ea7db-0207-41f2-bd83-5169ca92fb7b) with disk offering Small (19038d59-7fd9-402d-bbbb-ff3782251a19) and size (5.00 GB)<PHONE_NUMBER>",
      "domain": "ROOT",
      "domainid": "52d83793-26de-11ec-8dcf-5254005dcdac",
      "enddate": "2023-07-20T19:59:59+0000",
      "offeringid": "19038d59-7fd9-402d-bbbb-ff3782251a19",
      "rawusage": "1",
      "size":<PHONE_NUMBER>,
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "usage": "1 Hrs",
      "usageid": "976ea7db-0207-41f2-bd83-5169ca92fb7b",
      "usagetype": 6,
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "admin",
      "accountid": "af16aaed-26de-11ec-8dcf-5254005dcdac",
      "description": "Volume usage for ROOT-180 (44ac734b-5d22-4079-89c8-9810c76159f7) and template Ubuntu Bionic (bb4b7b6f-5249-4c18-a5f6-dd886683b702) and size (8.00 GB)<PHONE_NUMBER>",
      "domain": "ROOT",
      "domainid": "52d83793-26de-11ec-8dcf-5254005dcdac",
      "enddate": "2023-07-20T19:59:59+0000",
      "rawusage": "1",
      "size":<PHONE_NUMBER>,
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "templateid": "bb4b7b6f-5249-4c18-a5f6-dd886683b702",
      "usage": "1 Hrs",
      "usageid": "44ac734b-5d22-4079-89c8-9810c76159f7",
      "usagetype": 6,
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "admin",
      "accountid": "af16aaed-26de-11ec-8dcf-5254005dcdac",
      "description": "Template usage for Ubuntu Bionic (bb4b7b6f-5249-4c18-a5f6-dd886683b702) with size (2.60 GB)<PHONE_NUMBER> and virtual size (8.00 GB)<PHONE_NUMBER>",
      "domain": "ROOT",
      "domainid": "52d83793-26de-11ec-8dcf-5254005dcdac",
      "enddate": "2023-07-20T19:59:59+0000",
      "rawusage": "1",
      "size":<PHONE_NUMBER>,
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "usage": "1 Hrs",
      "usageid": "bb4b7b6f-5249-4c18-a5f6-dd886683b702",
      "usagetype": 7,
      "virtualsize":<PHONE_NUMBER>,
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "admin",
      "accountid": "af16aaed-26de-11ec-8dcf-5254005dcdac",
      "description": "Template usage for systemvm-kvm-4.18.0 (26c260f1-d7e9-4330-9887-464cd6f97ffc) with size (439.19 MB) 460521472 and virtual size (4.88 GB)<PHONE_NUMBER>",
      "domain": "ROOT",
      "domainid": "52d83793-26de-11ec-8dcf-5254005dcdac",
      "enddate": "2023-07-20T19:59:59+0000",
      "rawusage": "1",
      "size": 460521472,
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "usage": "1 Hrs",
      "usageid": "26c260f1-d7e9-4330-9887-464cd6f97ffc",
      "usagetype": 7,
      "virtualsize":<PHONE_NUMBER>,
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "admin",
      "accountid": "af16aaed-26de-11ec-8dcf-5254005dcdac",
      "description": "Template usage for systemvm-kvm-4.16.0 (1e25218a-3b25-493b-bbbf-389331ababb8) with size (513.04 MB) 537964544 and virtual size (3.91 GB)<PHONE_NUMBER>",
      "domain": "ROOT",
      "domainid": "52d83793-26de-11ec-8dcf-5254005dcdac",
      "enddate": "2023-07-20T19:59:59+0000",
      "rawusage": "1",
      "size": 537964544,
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "usage": "1 Hrs",
      "usageid": "1e25218a-3b25-493b-bbbf-389331ababb8",
      "usagetype": 7,
      "virtualsize":<PHONE_NUMBER>,
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "admin",
      "accountid": "af16aaed-26de-11ec-8dcf-5254005dcdac",
      "description": "Network offering DefaultIsolatedNetworkOfferingWithSourceNatService (06e40866-5ffb-4e1e-a985-ad5fcff3ddc1) usage for VM VM-3d0a5c66-676a-4458-8c4d-ca74ad2d1a63 (3d0a5c66-676a-4458-8c4d-ca74ad2d1a63) ",
      "domain": "ROOT",
      "domainid": "52d83793-26de-11ec-8dcf-5254005dcdac",
      "enddate": "2023-07-20T19:59:59+0000",
      "isdefault": true,
      "offeringid": "06e40866-5ffb-4e1e-a985-ad5fcff3ddc1",
      "rawusage": "1",
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "usage": "1 Hrs",
      "usagetype": 13,
      "virtualmachineid": "3d0a5c66-676a-4458-8c4d-ca74ad2d1a63",
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "admin",
      "accountid": "af16aaed-26de-11ec-8dcf-5254005dcdac",
      "description": "Network offering DefaultIsolatedNetworkOfferingWithSourceNatService (06e40866-5ffb-4e1e-a985-ad5fcff3ddc1) usage for VM VM-445c705c-5c89-491c-a791-431417c8a9a4 (445c705c-5c89-491c-a791-431417c8a9a4) ",
      "domain": "ROOT",
      "domainid": "52d83793-26de-11ec-8dcf-5254005dcdac",
      "enddate": "2023-07-20T19:59:59+0000",
      "isdefault": true,
      "offeringid": "06e40866-5ffb-4e1e-a985-ad5fcff3ddc1",
      "rawusage": "1",
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "usage": "1 Hrs",
      "usagetype": 13,
      "virtualmachineid": "445c705c-5c89-491c-a791-431417c8a9a4",
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "admin",
      "accountid": "af16aaed-26de-11ec-8dcf-5254005dcdac",
      "description": "Network offering DefaultIsolatedNetworkOfferingWithSourceNatService (06e40866-5ffb-4e1e-a985-ad5fcff3ddc1) usage for VM sem2 (639fa094-13c5-4e4f-99d3-5c2727710f96) ",
      "domain": "ROOT",
      "domainid": "52d83793-26de-11ec-8dcf-5254005dcdac",
      "enddate": "2023-07-20T19:59:59+0000",
      "isdefault": true,
      "offeringid": "06e40866-5ffb-4e1e-a985-ad5fcff3ddc1",
      "rawusage": "1",
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "usage": "1 Hrs",
      "usagetype": 13,
      "virtualmachineid": "639fa094-13c5-4e4f-99d3-5c2727710f96",
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "admin",
      "accountid": "af16aaed-26de-11ec-8dcf-5254005dcdac",
      "description": "Network offering DefaultIsolatedNetworkOfferingWithSourceNatService (06e40866-5ffb-4e1e-a985-ad5fcff3ddc1) usage for VM VM-73680a37-cdb1-4860-91b3-268ba7d31b76 (73680a37-cdb1-4860-91b3-268ba7d31b76) ",
      "domain": "ROOT",
      "domainid": "52d83793-26de-11ec-8dcf-5254005dcdac",
      "enddate": "2023-07-20T19:59:59+0000",
      "isdefault": true,
      "offeringid": "06e40866-5ffb-4e1e-a985-ad5fcff3ddc1",
      "rawusage": "1",
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "usage": "1 Hrs",
      "usagetype": 13,
      "virtualmachineid": "73680a37-cdb1-4860-91b3-268ba7d31b76",
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "admin",
      "accountid": "af16aaed-26de-11ec-8dcf-5254005dcdac",
      "description": "Network offering DefaultIsolatedNetworkOfferingWithSourceNatService (06e40866-5ffb-4e1e-a985-ad5fcff3ddc1) usage for VM testeApi3 (e595a667-9b3d-4e24-9383-3e69fc3f3c56) ",
      "domain": "ROOT",
      "domainid": "52d83793-26de-11ec-8dcf-5254005dcdac",
      "enddate": "2023-07-20T19:59:59+0000",
      "isdefault": true,
      "offeringid": "06e40866-5ffb-4e1e-a985-ad5fcff3ddc1",
      "rawusage": "1",
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "usage": "1 Hrs",
      "usagetype": 13,
      "virtualmachineid": "e595a667-9b3d-4e24-9383-3e69fc3f3c56",
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "admin",
      "accountid": "af16aaed-26de-11ec-8dcf-5254005dcdac",
      "description": "Network offering DefaultIsolatedNetworkOfferingWithSourceNatService (06e40866-5ffb-4e1e-a985-ad5fcff3ddc1) usage for VM testeApi (2e154790-48ea-4923-ba77-7288f01f9c02) ",
      "domain": "ROOT",
      "domainid": "52d83793-26de-11ec-8dcf-5254005dcdac",
      "enddate": "2023-07-20T19:59:59+0000",
      "isdefault": true,
      "offeringid": "06e40866-5ffb-4e1e-a985-ad5fcff3ddc1",
      "rawusage": "1",
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "usage": "1 Hrs",
      "usagetype": 13,
      "virtualmachineid": "2e154790-48ea-4923-ba77-7288f01f9c02",
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "admin",
      "accountid": "af16aaed-26de-11ec-8dcf-5254005dcdac",
      "description": "Network offering DefaultIsolatedNetworkOfferingWithSourceNatService (06e40866-5ffb-4e1e-a985-ad5fcff3ddc1) usage for VM x (7093969e-fe33-4bd9-977d-41c6b424a927) ",
      "domain": "ROOT",
      "domainid": "52d83793-26de-11ec-8dcf-5254005dcdac",
      "enddate": "2023-07-20T19:59:59+0000",
      "isdefault": true,
      "offeringid": "06e40866-5ffb-4e1e-a985-ad5fcff3ddc1",
      "rawusage": "1",
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "usage": "1 Hrs",
      "usagetype": 13,
      "virtualmachineid": "7093969e-fe33-4bd9-977d-41c6b424a927",
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "admin",
      "accountid": "af16aaed-26de-11ec-8dcf-5254005dcdac",
      "description": "Network offering DefaultIsolatedNetworkOfferingWithSourceNatService (06e40866-5ffb-4e1e-a985-ad5fcff3ddc1) usage for VM testeApi2 (4ca5b22e-6e8a-4bf1-9819-b980f826f05a) ",
      "domain": "ROOT",
      "domainid": "52d83793-26de-11ec-8dcf-5254005dcdac",
      "enddate": "2023-07-20T19:59:59+0000",
      "isdefault": true,
      "offeringid": "06e40866-5ffb-4e1e-a985-ad5fcff3ddc1",
      "rawusage": "1",
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "usage": "1 Hrs",
      "usagetype": 13,
      "virtualmachineid": "4ca5b22e-6e8a-4bf1-9819-b980f826f05a",
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "admin",
      "accountid": "af16aaed-26de-11ec-8dcf-5254005dcdac",
      "description": "IPAddress: <IP_ADDRESS>",
      "domain": "ROOT",
      "domainid": "52d83793-26de-11ec-8dcf-5254005dcdac",
      "enddate": "2023-07-20T19:59:59+0000",
      "issourcenat": true,
      "issystem": false,
      "rawusage": "1",
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "usage": "1 Hrs",
      "usageid": "a412731c-0841-41a7-ac57-932ea9fe75a0",
      "usagetype": 3,
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "admin",
      "accountid": "af16aaed-26de-11ec-8dcf-5254005dcdac",
      "description": "IPAddress: <IP_ADDRESS>",
      "domain": "ROOT",
      "domainid": "52d83793-26de-11ec-8dcf-5254005dcdac",
      "enddate": "2023-07-20T19:59:59+0000",
      "issourcenat": true,
      "issystem": false,
      "rawusage": "1",
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "usage": "1 Hrs",
      "usageid": "90f59d4f-c879-424d-a1d9-867364b86009",
      "usagetype": 3,
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "admin",
      "accountid": "af16aaed-26de-11ec-8dcf-5254005dcdac",
      "description": "IPAddress: <IP_ADDRESS>",
      "domain": "ROOT",
      "domainid": "52d83793-26de-11ec-8dcf-5254005dcdac",
      "enddate": "2023-07-20T19:59:59+0000",
      "issourcenat": true,
      "issystem": false,
      "rawusage": "1",
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "usage": "1 Hrs",
      "usageid": "cb973a92-91b3-4d47-9296-72850322e25b",
      "usagetype": 3,
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "admin",
      "accountid": "af16aaed-26de-11ec-8dcf-5254005dcdac",
      "description": "Network usage for network ID: 207, network offering: 8",
      "domain": "ROOT",
      "domainid": "52d83793-26de-11ec-8dcf-5254005dcdac",
      "enddate": "2023-07-20T19:59:59+0000",
      "rawusage": "1",
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "usage": "1 Hrs",
      "usagetype": 30,
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "admin",
      "accountid": "af16aaed-26de-11ec-8dcf-5254005dcdac",
      "description": "Network usage for network ID: 207, network offering: 8",
      "domain": "ROOT",
      "domainid": "52d83793-26de-11ec-8dcf-5254005dcdac",
      "enddate": "2023-07-20T19:59:59+0000",
      "rawusage": "1",
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "usage": "1 Hrs",
      "usagetype": 30,
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "admin",
      "accountid": "af16aaed-26de-11ec-8dcf-5254005dcdac",
      "description": "Network usage for network ID: 207, network offering: 8",
      "domain": "ROOT",
      "domainid": "52d83793-26de-11ec-8dcf-5254005dcdac",
      "enddate": "2023-07-20T19:59:59+0000",
      "rawusage": "1",
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "usage": "1 Hrs",
      "usagetype": 30,
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "admin",
      "accountid": "af16aaed-26de-11ec-8dcf-5254005dcdac",
      "description": "Network usage for network ID: 207, network offering: 8",
      "domain": "ROOT",
      "domainid": "52d83793-26de-11ec-8dcf-5254005dcdac",
      "enddate": "2023-07-20T19:59:59+0000",
      "rawusage": "1",
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "usage": "1 Hrs",
      "usagetype": 30,
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "admin",
      "accountid": "af16aaed-26de-11ec-8dcf-5254005dcdac",
      "description": "Network usage for network ID: 209, network offering: 8",
      "domain": "ROOT",
      "domainid": "52d83793-26de-11ec-8dcf-5254005dcdac",
      "enddate": "2023-07-20T19:59:59+0000",
      "rawusage": "1",
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "usage": "1 Hrs",
      "usagetype": 30,
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "admin",
      "accountid": "af16aaed-26de-11ec-8dcf-5254005dcdac",
      "description": "Network usage for network ID: 209, network offering: 8",
      "domain": "ROOT",
      "domainid": "52d83793-26de-11ec-8dcf-5254005dcdac",
      "enddate": "2023-07-20T19:59:59+0000",
      "rawusage": "1",
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "usage": "1 Hrs",
      "usagetype": 30,
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "teste",
      "accountid": "8f839837-f5b8-48c2-8d6b-fbd0e5b98683",
      "description": "Volume usage for aa (81d17d90-0b0f-42a9-b73e-5575366902cb) with disk offering Small (19038d59-7fd9-402d-bbbb-ff3782251a19) and size (5.00 GB)<PHONE_NUMBER>",
      "domain": "teste",
      "domainid": "27d26602-c941-4c5d-8a2c-cdfcb7ff3dce",
      "enddate": "2023-07-20T19:59:59+0000",
      "offeringid": "19038d59-7fd9-402d-bbbb-ff3782251a19",
      "rawusage": "1",
      "size":<PHONE_NUMBER>,
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "usage": "1 Hrs",
      "usageid": "81d17d90-0b0f-42a9-b73e-5575366902cb",
      "usagetype": 6,
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "teste",
      "accountid": "8f839837-f5b8-48c2-8d6b-fbd0e5b98683",
      "description": "Volume usage for ROOT-139 (244dd606-fbd9-40af-b081-fe959687201f) with disk offering Small Instance (ab647165-7a0a-4984-8452-7bfceb036528) and template CentOS 5.5(64-bit) no GUI (KVM) (52e1d1a5-26de-11ec-8dcf-5254005dcdac) and size (8.00 GB)<PHONE_NUMBER>",
      "domain": "teste",
      "domainid": "27d26602-c941-4c5d-8a2c-cdfcb7ff3dce",
      "enddate": "2023-07-20T19:59:59+0000",
      "offeringid": "ab647165-7a0a-4984-8452-7bfceb036528",
      "rawusage": "1",
      "size":<PHONE_NUMBER>,
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "templateid": "52e1d1a5-26de-11ec-8dcf-5254005dcdac",
      "usage": "1 Hrs",
      "usageid": "244dd606-fbd9-40af-b081-fe959687201f",
      "usagetype": 6,
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "teste",
      "accountid": "8f839837-f5b8-48c2-8d6b-fbd0e5b98683",
      "description": "Volume usage for DATA-139 (e040fff3-783a-47bf-9fb6-963f894c4e07) with disk offering Small (19038d59-7fd9-402d-bbbb-ff3782251a19) and size (5.00 GB)<PHONE_NUMBER>",
      "domain": "teste",
      "domainid": "27d26602-c941-4c5d-8a2c-cdfcb7ff3dce",
      "enddate": "2023-07-20T19:59:59+0000",
      "offeringid": "19038d59-7fd9-402d-bbbb-ff3782251a19",
      "rawusage": "1",
      "size":<PHONE_NUMBER>,
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "usage": "1 Hrs",
      "usageid": "e040fff3-783a-47bf-9fb6-963f894c4e07",
      "usagetype": 6,
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "teste",
      "accountid": "8f839837-f5b8-48c2-8d6b-fbd0e5b98683",
      "description": "Network offering DefaultIsolatedNetworkOfferingWithSourceNatService (06e40866-5ffb-4e1e-a985-ad5fcff3ddc1) usage for VM x (ff718261-086b-4245-bd16-444ef08dd84a) ",
      "domain": "teste",
      "domainid": "27d26602-c941-4c5d-8a2c-cdfcb7ff3dce",
      "enddate": "2023-07-20T19:59:59+0000",
      "isdefault": false,
      "offeringid": "06e40866-5ffb-4e1e-a985-ad5fcff3ddc1",
      "rawusage": "1",
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "usage": "1 Hrs",
      "usagetype": 13,
      "virtualmachineid": "ff718261-086b-4245-bd16-444ef08dd84a",
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "teste",
      "accountid": "8f839837-f5b8-48c2-8d6b-fbd0e5b98683",
      "description": "IPAddress: <IP_ADDRESS>",
      "domain": "teste",
      "domainid": "27d26602-c941-4c5d-8a2c-cdfcb7ff3dce",
      "enddate": "2023-07-20T19:59:59+0000",
      "issourcenat": false,
      "issystem": false,
      "rawusage": "1",
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "usage": "1 Hrs",
      "usageid": "d5ed1304-4e2b-47fe-a17a-4d5b66283ba6",
      "usagetype": 3,
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "teste",
      "accountid": "8f839837-f5b8-48c2-8d6b-fbd0e5b98683",
      "description": "IPAddress: <IP_ADDRESS>",
      "domain": "teste",
      "domainid": "27d26602-c941-4c5d-8a2c-cdfcb7ff3dce",
      "enddate": "2023-07-20T19:59:59+0000",
      "issourcenat": true,
      "issystem": false,
      "rawusage": "1",
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "usage": "1 Hrs",
      "usageid": "9cbe58be-3a87-4ee9-ad52-066cc9909f4f",
      "usagetype": 3,
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "teste",
      "accountid": "8f839837-f5b8-48c2-8d6b-fbd0e5b98683",
      "description": "IPAddress: <IP_ADDRESS>",
      "domain": "teste",
      "domainid": "27d26602-c941-4c5d-8a2c-cdfcb7ff3dce",
      "enddate": "2023-07-20T19:59:59+0000",
      "issourcenat": false,
      "issystem": false,
      "rawusage": "1",
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "usage": "1 Hrs",
      "usageid": "ed10e53a-5179-4d81-9607-ffc6aaf41473",
      "usagetype": 3,
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "teste",
      "accountid": "8f839837-f5b8-48c2-8d6b-fbd0e5b98683",
      "description": "IPAddress: <IP_ADDRESS>",
      "domain": "teste",
      "domainid": "27d26602-c941-4c5d-8a2c-cdfcb7ff3dce",
      "enddate": "2023-07-20T19:59:59+0000",
      "issourcenat": false,
      "issystem": false,
      "rawusage": "1",
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "usage": "1 Hrs",
      "usageid": "b1f2bf55-d564-448b-94e0-d5f39ab7db81",
      "usagetype": 3,
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "teste",
      "accountid": "8f839837-f5b8-48c2-8d6b-fbd0e5b98683",
      "description": "IPAddress: <IP_ADDRESS>",
      "domain": "teste",
      "domainid": "27d26602-c941-4c5d-8a2c-cdfcb7ff3dce",
      "enddate": "2023-07-20T19:59:59+0000",
      "issourcenat": true,
      "issystem": false,
      "rawusage": "1",
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "usage": "1 Hrs",
      "usageid": "96892fdd-a548-4231-ae1e-8b5c9cd898d7",
      "usagetype": 3,
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "teste",
      "accountid": "8f839837-f5b8-48c2-8d6b-fbd0e5b98683",
      "description": "IPAddress: <IP_ADDRESS>",
      "domain": "teste",
      "domainid": "27d26602-c941-4c5d-8a2c-cdfcb7ff3dce",
      "enddate": "2023-07-20T19:59:59+0000",
      "issourcenat": false,
      "issystem": false,
      "rawusage": "1",
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "usage": "1 Hrs",
      "usageid": "ce872471-7654-4c93-b5cb-d6247dff7f1b",
      "usagetype": 3,
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "teste",
      "accountid": "8f839837-f5b8-48c2-8d6b-fbd0e5b98683",
      "description": "Network usage for network ID: 208, network offering: 8",
      "domain": "teste",
      "domainid": "27d26602-c941-4c5d-8a2c-cdfcb7ff3dce",
      "enddate": "2023-07-20T19:59:59+0000",
      "rawusage": "1",
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "usage": "1 Hrs",
      "usagetype": 30,
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "teste",
      "accountid": "8f839837-f5b8-48c2-8d6b-fbd0e5b98683",
      "description": "Network usage for network ID: 208, network offering: 8",
      "domain": "teste",
      "domainid": "27d26602-c941-4c5d-8a2c-cdfcb7ff3dce",
      "enddate": "2023-07-20T19:59:59+0000",
      "rawusage": "1",
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "usage": "1 Hrs",
      "usagetype": 30,
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "teste",
      "accountid": "8f839837-f5b8-48c2-8d6b-fbd0e5b98683",
      "description": "Network usage for network ID: 208, network offering: 8",
      "domain": "teste",
      "domainid": "27d26602-c941-4c5d-8a2c-cdfcb7ff3dce",
      "enddate": "2023-07-20T19:59:59+0000",
      "rawusage": "1",
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "usage": "1 Hrs",
      "usagetype": 30,
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "teste",
      "accountid": "8f839837-f5b8-48c2-8d6b-fbd0e5b98683",
      "description": "Network usage for network ID: 208, network offering: 8",
      "domain": "teste",
      "domainid": "27d26602-c941-4c5d-8a2c-cdfcb7ff3dce",
      "enddate": "2023-07-20T19:59:59+0000",
      "rawusage": "1",
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "usage": "1 Hrs",
      "usagetype": 30,
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "teste",
      "accountid": "8f839837-f5b8-48c2-8d6b-fbd0e5b98683",
      "description": "VPC usage for VPC ID: 4",
      "domain": "teste",
      "domainid": "27d26602-c941-4c5d-8a2c-cdfcb7ff3dce",
      "enddate": "2023-07-20T19:59:59+0000",
      "rawusage": "1",
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "usage": "1 Hrs",
      "usagetype": 29,
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "teste2",
      "accountid": "e21597af-e98c-4f1d-b6cd-9e79e6b3a6d5",
      "description": "Network usage for network ID: 210, network offering: 8",
      "domain": "teste2",
      "domainid": "2c8f263c-3b07-4f70-a473-a2cd4154e302",
      "enddate": "2023-07-20T19:59:59+0000",
      "rawusage": "1",
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "usage": "1 Hrs",
      "usagetype": 30,
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "teste2",
      "accountid": "e21597af-e98c-4f1d-b6cd-9e79e6b3a6d5",
      "description": "Network usage for network ID: 210, network offering: 8",
      "domain": "teste2",
      "domainid": "2c8f263c-3b07-4f70-a473-a2cd4154e302",
      "enddate": "2023-07-20T19:59:59+0000",
      "rawusage": "1",
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "usage": "1 Hrs",
      "usagetype": 30,
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    },
    {
      "account": "z",
      "accountid": "a7e67e12-f460-44d7-a3b0-5db5981154ef",
      "description": "Volume usage for 1cb53077-b0a5-4097-8584-5debb939f2fb (d537e128-a359-4097-9fdb-cb74f01225fd) with disk offering Small (19038d59-7fd9-402d-bbbb-ff3782251a19) and size (5.00 GB)<PHONE_NUMBER>",
      "domain": "teste",
      "domainid": "27d26602-c941-4c5d-8a2c-cdfcb7ff3dce",
      "enddate": "2023-07-20T19:59:59+0000",
      "offeringid": "19038d59-7fd9-402d-bbbb-ff3782251a19",
      "rawusage": "1",
      "size":<PHONE_NUMBER>,
      "startdate": "2023-07-20T19:00:00+0000",
      "tags": [],
      "usage": "1 Hrs",
      "usageid": "d537e128-a359-4097-9fdb-cb74f01225fd",
      "usagetype": 6,
      "zoneid": "8b2ceb16-a2f2-40ea-8968-9e08984bdb17"
    }
  ]
}

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 yyyy-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.

@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 yyyy-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

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:
(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:
(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.
(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:
(admin) 🐱 > list usagerecords startdate='2024-01-22T19:00:00+1100' enddate='2024-01-23T04:00:00+1100'

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:
(admin) 🐱 > list usagerecords startdate='2024-01-22T19:00:00+1100' enddate='2024-01-23T07:59:00+1100'

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:
(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.
(admin) 🐱 > quota tariffcreate name="test2A" value=2 usagetype=1 startdate="2024-01-25T01:00:00+1100" enddate="2024-01-25T04:00:00+1100"
{
  "quotatariff": {
    "currency": "$",
    "effectiveDate": "2024-01-24T19:00:00+0800",
    "endDate": "2024-01-24T22:00:00+0800",
    "name": "test2A",
    "tariffValue": 2,
    "usageDiscriminator": "None",
    "usageName": "RUNNING_VM",
    "usageType": 1,
    "usageTypeDescription": "Running Vm Usage",
    "usageUnit": "Compute*Month",
    "uuid": "c22ac24b-45ea-4ba2-8dc2-533592ac46ca"
  }
}

Both effectiveDate and endDate do not get set to the expected value.
Just to ensure that this is not a problem only with the API's response, I verified that they are indeed wrong in the database:
+----+------------------------+---------------------+---------------------+
| id | name                   | effective_on        | end_date            |
+----+------------------------+---------------------+---------------------+
| 26 | testA                  | 2024-01-23 11:00:00 | NULL                |
| 27 | test2A                 | 2024-01-24 11:00:00 | 2024-01-24 14:00:00 |
+----+------------------------+---------------------+---------------------+

After:
(admin) 🐱 > quota tariffcreate name="testB" value=2 usagetype=1 startdate="2024-01-24T01:00:00+1100"
{
  "quotatariff": {
    "currency": "$",
    "effectiveDate": "2024-01-23T22:00:00+0800",
    "id": "201b2163-8194-48ff-a048-c36453677538",
    "name": "testB",
    "tariffValue": 2,
    "usageDiscriminator": "None",
    "usageName": "RUNNING_VM",
    "usageType": 1,
    "usageTypeDescription": "Running Vm Usage",
    "usageUnit": "Compute*Month"
  }
}

effectiveDate gets set to the correct value.
(admin) 🐱 > quota tariffcreate name="test2B" value=2 usagetype=1 startdate="2024-01-25T01:00:00+1100" enddate="2024-01-25T04:00:00+1100"
{
  "quotatariff": {
    "currency": "$",
    "effectiveDate": "2024-01-24T22:00:00+0800",
    "endDate": "2024-01-25T01:00:00+0800",
    "id": "6f7f9250-425b-493d-8cc0-7b5158d73ea4",
    "name": "test2B",
    "tariffValue": 2,
    "usageDiscriminator": "None",
    "usageName": "RUNNING_VM",
    "usageType": 1,
    "usageTypeDescription": "Running Vm Usage",
    "usageUnit": "Compute*Month"
  }
}

Both effectiveDate and endDate get set to the provided values.
In the database:
+----+------------------------+---------------------+---------------------+
| id | name                   | effective_on        | end_date            |
+----+------------------------+---------------------+---------------------+
| 30 | testB                  | 2024-01-23 14:00:00 | NULL                |
| 31 | test2B                 | 2024-01-24 14:00:00 | 2024-01-24 17:00:00 |
+----+------------------------+---------------------+---------------------+

I also verified that this issue was present in quotaTariffUpdate, and that it has been fixed.

Other tests:

listUsageRecords

(admin) 🐱 > list usagerecords startdate='2024-01-22 19:00:00' enddate='2024-01-23 07:59:00'
...

2024-01-24 00:07:06,185 DEBUG [c.c.u.UsageServiceImpl] (qtp391630194-15:ctx-49d437aa ctx-40c137c4) (logid:a6160874) Getting usage records for account [2] in domain [null], between [Mon Jan 22 19:00:00 SGT 2024] and [Tue Jan 23 07:59:00 SGT 2024], using pageSize [500] and startIndex [0].

When not adding a timezone, startdate and enddate are considered in the MS's timezone. I verified that the last usage record had the startdate of 2024-01-23T06:00:00+0800 and enddate of 2024-01-23T06:59:59+0800.

quotaStatement

(admin) 🐱 > quota statement account=admin domainid=72b54c4a-771d-11ee-8e59-5254003754dc startdate=2024-01-19T13:00:00+1100 enddate=2024-01-20
{
  "statement": {
    "currency": "$",
    "enddate": "2024-01-20T23:59:59+0800",
    "quotausage": [
      {
        "accountid": 2,
        "domain": 1,
        "name": "RUNNING_VM",
        "quota": 0,
        "type": 1,
        "unit": "Compute*Month"
      },
      {
        "accountid": 2,
        "domain": 1,
        "name": "ALLOCATED_VM",
        "quota": 0,
        "type": 2,
        "unit": "Compute*Month"
      },
      {
        "accountid": 2,
        "domain": 1,
        "name": "IP_ADDRESS",
        "quota": 0,
        "type": 3,
        "unit": "IP*Month"
      },
      {
        "accountid": 2,
        "domain": 1,
        "name": "NETWORK_BYTES_SENT",
        "quota": 0,
        "type": 4,
        "unit": "GB"
      },
      {
        "accountid": 2,
        "domain": 1,
        "name": "NETWORK_BYTES_RECEIVED",
        "quota": 0,
        "type": 5,
        "unit": "GB"
      },
      {
        "accountid": 2,
        "domain": 1,
        "name": "VOLUME",
        "quota": 0,
        "type": 6,
        "unit": "GB*Month"
      },
      {
        "accountid": 2,
        "domain": 1,
        "name": "TEMPLATE",
        "quota": 0,
        "type": 7,
        "unit": "GB*Month"
      },
      {
        "accountid": 2,
        "domain": 1,
        "name": "ISO",
        "quota": 0,
        "type": 8,
        "unit": "GB*Month"
      },
      {
        "accountid": 2,
        "domain": 1,
        "name": "SNAPSHOT",
        "quota": 0,
        "type": 9,
        "unit": "GB*Month"
      },
      {
        "accountid": 2,
        "domain": 1,
        "name": "SECURITY_GROUP",
        "quota": 0,
        "type": 10,
        "unit": "Policy*Month"
      },
      {
        "accountid": 2,
        "domain": 1,
        "name": "LOAD_BALANCER_POLICY",
        "quota": 0,
        "type": 11,
        "unit": "Policy*Month"
      },
      {
        "accountid": 2,
        "domain": 1,
        "name": "PORT_FORWARDING_RULE",
        "quota": 0,
        "type": 12,
        "unit": "Policy*Month"
      },
      {
        "accountid": 2,
        "domain": 1,
        "name": "NETWORK_OFFERING",
        "quota": 0,
        "type": 13,
        "unit": "Policy*Month"
      },
      {
        "accountid": 2,
        "domain": 1,
        "name": "VPN_USERS",
        "quota": 0,
        "type": 14,
        "unit": "Policy*Month"
      },
      {
        "accountid": 2,
        "domain": 1,
        "name": "VM_DISK_IO_READ",
        "quota": 0,
        "type": 21,
        "unit": "IOPS"
      },
      {
        "accountid": 2,
        "domain": 1,
        "name": "VM_DISK_IO_WRITE",
        "quota": 0,
        "type": 22,
        "unit": "IOPS"
      },
      {
        "accountid": 2,
        "domain": 1,
        "name": "VM_DISK_BYTES_READ",
        "quota": 0,
        "type": 23,
        "unit": "Bytes"
      },
      {
        "accountid": 2,
        "domain": 1,
        "name": "VM_DISK_BYTES_WRITE",
        "quota": 0,
        "type": 24,
        "unit": "Bytes"
      },
      {
        "accountid": 2,
        "domain": 1,
        "name": "VM_SNAPSHOT",
        "quota": 0,
        "type": 25,
        "unit": "GB*Month"
      },
      {
        "accountid": 2,
        "domain": 1,
        "name": "VOLUME_SECONDARY",
        "quota": 0,
        "type": 26,
        "unit": "GB*Month"
      },
      {
        "accountid": 2,
        "domain": 1,
        "name": "VM_SNAPSHOT_ON_PRIMARY",
        "quota": 0,
        "type": 27,
        "unit": "GB*Month"
      },
      {
        "accountid": 2,
        "domain": 1,
        "name": "BACKUP",
        "quota": 0,
        "type": 28,
        "unit": "GB*Month"
      }
    ],
    "startdate": "2024-01-19T10:00:00+0800",
    "totalquota": 0
  }
}

startdate and enddate use the provided values (enddate gets set to the end of a day according to the MS's timezone).

quotaTariffCreate

(admin) 🐱 > quota tariffcreate name="testtimezonenotprovided" value=2 usagetype=1 startdate="2024-01-24 10:00:00" enddate="2024-01-25 12:00:00"
{
  "quotatariff": {
    "currency": "$",
    "effectiveDate": "2024-01-24T10:00:00+0800",
    "endDate": "2024-01-25T12:00:00+0800",
    "id": "ef836a1d-958a-4113-a9da-3121986628a4",
    "name": "testtimezonenotprovided",
    "tariffValue": 2,
    "usageDiscriminator": "None",
    "usageName": "RUNNING_VM",
    "usageType": 1,
    "usageTypeDescription": "Running Vm Usage",
    "usageUnit": "Compute*Month"
  }
}

The tariff is created with the provided dates in the MS's timezone.

quotaTariffUpdate

(admin) 🐱 > quota tariffupdate name=testB enddate=2024-01-26
{
  "quotatariff": {
    "currency": "$",
    "effectiveDate": "2024-01-23T22:00:00+0800",
    "endDate": "2024-01-26T23:59:59+0800",
    "id": "7fc5f42a-bc0e-4848-89d7-35eacc64504d",
    "name": "testB",
    "tariffValue": 2,
    "usageDiscriminator": "None",
    "usageName": "RUNNING_VM",
    "usageType": 1,
    "usageTypeDescription": "Running Vm Usage",
    "usageUnit": "Compute*Month"
  }
}

(admin) 🐱 > quota tariffupdate name=testB enddate=2024-01-26T23:59:59+1100
{
  "quotatariff": {
    "currency": "$",
    "effectiveDate": "2024-01-23T22:00:00+0800",
    "endDate": "2024-01-26T20:59:59+0800",
    "id": "a2e323b7-10b5-4018-aa9d-e50bbee079ff",
    "name": "testB",
    "tariffValue": 2,
    "usageDiscriminator": "None",
    "usageName": "RUNNING_VM",
    "usageType": 1,
    "usageTypeDescription": "Running Vm Usage",
    "usageUnit": "Compute*Month"
  }
}

Dates are updated according to the provided values.

quotaTariffList

(admin) 🐱 > quota tarifflist startdate=2024-01-25 enddate=2024-01-26
{
  "count": 1,
  "quotatariff": [
    {
      "currency": "$",
      "effectiveDate": "2024-01-25T00:00:00+0800",
      "endDate": "2024-01-25T23:59:59+0800",
      "id": "473451f8-b895-49d5-801c-c4eeea242ec0",
      "name": "test3B",
      "tariffValue": 2,
      "usageDiscriminator": "None",
      "usageName": "RUNNING_VM",
      "usageType": 1,
      "usageTypeDescription": "Running Vm Usage",
      "usageUnit": "Compute*Month"
    }
  ]
}

(admin) 🐱 > quota tarifflist startdate=2024-01-25 enddate=2024-01-25T23:59:59+0800
{
  "count": 1,
  "quotatariff": [
    {
      "currency": "$",
      "effectiveDate": "2024-01-25T00:00:00+0800",
      "endDate": "2024-01-25T23:59:59+0800",
      "id": "473451f8-b895-49d5-801c-c4eeea242ec0",
      "name": "test3B",
      "tariffValue": 2,
      "usageDiscriminator": "None",
      "usageName": "RUNNING_VM",
      "usageType": 1,
      "usageTypeDescription": "Running Vm Usage",
      "usageUnit": "Compute*Month"
    }
  ]
}

(admin) 🐱 > quota tarifflist startdate=2024-01-25 enddate=2024-01-25T23:59:58+0800
<nothing>

(admin) 🐱 > quota tarifflist startdate=2024-01-24T01:00:00+1100 enddate=2024-01-26
{
  "count": 3,
  "quotatariff": [
    {
      "currency": "$",
      "effectiveDate": "2024-01-25T00:00:00+0800",
      "endDate": "2024-01-25T23:59:59+0800",
      "id": "473451f8-b895-49d5-801c-c4eeea242ec0",
      "name": "test3B",
      "tariffValue": 2,
      "usageDiscriminator": "None",
      "usageName": "RUNNING_VM",
      "usageType": 1,
      "usageTypeDescription": "Running Vm Usage",
      "usageUnit": "Compute*Month"
    },
    {
      "currency": "$",
      "effectiveDate": "2024-01-24T22:00:00+0800",
      "endDate": "2024-01-25T01:00:00+0800",
      "id": "6f7f9250-425b-493d-8cc0-7b5158d73ea4",
      "name": "test2B",
      "tariffValue": 2,
      "usageDiscriminator": "None",
      "usageName": "RUNNING_VM",
      "usageType": 1,
      "usageTypeDescription": "Running Vm Usage",
      "usageUnit": "Compute*Month"
    },
    {
      "currency": "$",
      "effectiveDate": "2024-01-23T22:00:00+0800",
      "endDate": "2024-01-26T23:59:59+0800",
      "id": "aa615bcb-a9af-4b2c-8806-6711b8c13623",
      "name": "testB",
      "tariffValue": 2,
      "usageDiscriminator": "None",
      "usageName": "RUNNING_VM",
      "usageType": 1,
      "usageTypeDescription": "Running Vm Usage",
      "usageUnit": "Compute*Month"
    }
  ]
}

(admin) 🐱 > quota tarifflist startdate=2024-01-24T02:00:00+1100 enddate=2024-01-26
{
  "count": 2,
  "quotatariff": [
    {
      "currency": "$",
      "effectiveDate": "2024-01-25T00:00:00+0800",
      "endDate": "2024-01-25T23:59:59+0800",
      "id": "473451f8-b895-49d5-801c-c4eeea242ec0",
      "name": "test3B",
      "tariffValue": 2,
      "usageDiscriminator": "None",
      "usageName": "RUNNING_VM",
      "usageType": 1,
      "usageTypeDescription": "Running Vm Usage",
      "usageUnit": "Compute*Month"
    },
    {
      "currency": "$",
      "effectiveDate": "2024-01-24T22:00:00+0800",
      "endDate": "2024-01-25T01:00:00+0800",
      "id": "6f7f9250-425b-493d-8cc0-7b5158d73ea4",
      "name": "test2B",
      "tariffValue": 2,
      "usageDiscriminator": "None",
      "usageName": "RUNNING_VM",
      "usageType": 1,
      "usageTypeDescription": "Running Vm Usage",
      "usageUnit": "Compute*Month"
    }
  ]
}

Tariffs are filtered by startdate and enddate as expected.

quotaTariffDelete

(admin) 🐱 > quota tariffdelete id=ef836a1d-958a-4113-a9da-3121986628a4
{
  "success": true
}

Working as expected.

Could someone else also take a look at this PR? @shwstppr @rohityadavcloud

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

@blueorangutan package

@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.

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

@blueorangutan test

@DaanHoogland a [SL] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

[SF] Trillian test result (tid-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

@blueorangutan package

@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.

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

@blueorangutan test matrix

@DaanHoogland a [SL] Trillian-Jenkins matrix job (centos7 mgmt + xenserver71, rocky8 mgmt + vmware67u3, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests

[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

[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

[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

@blueorangutan test alma9 kvm-alma9

@DaanHoogland a [SL] Trillian-Jenkins test job (alma9 mgmt + kvm-alma9) has been kicked to run smoke tests

[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

@GutoVeronezi did you find time to test this?

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

@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?

@blueorangutan package

@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.

Codecov Report
Attention: Patch coverage is 45.71429% with 19 lines in your changes are missing coverage. Please review.

Project coverage is 31.12%.  Consider uploading reports for the commit 45c98c7 to get more accurate results

Files
Patch %
Lines

...udstack/api/response/QuotaResponseBuilderImpl.java
40.00%
6 Missing :warning:

.../org/apache/cloudstack/quota/QuotaServiceImpl.java
50.00%
4 Missing and 1 partial :warning:

...rc/main/java/com/cloud/usage/UsageServiceImpl.java
0.00%
5 Missing :warning:

...src/main/java/com/cloud/api/ApiResponseHelper.java
0.00%
2 Missing :warning:

...e/cloudstack/api/response/QuotaTariffResponse.java
50.00%
1 Missing :warning:

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #8243      +/-   ##
============================================
+ Coverage     30.72%   31.12%   +0.39%
- Complexity    33557    33933     +376
============================================
  Files          5406     5398       -8
  Lines        380310   379509     -801
  Branches      55531    55373     -158
============================================
+ Hits         116845   118110    +1265
+ Misses       247903   245745    -2158
- Partials      15562    15654      +92

Flag
Coverage Δ

simulator-marvin-tests
24.73% <0.00%> (+0.36%)
:arrow_up:

uitests
4.34% <ø> (+<0.01%)
:arrow_up:

unit-tests
16.89% <45.71%> (+0.01%)
:arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

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

@blueorangutan test alma9 kvm-alma9

@DaanHoogland a [SL] Trillian-Jenkins test job (alma9 mgmt + kvm-alma9) has been kicked to run smoke tests

[SF] Trillian Build Failed (tid-9705)

@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:

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
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.24111109972000122 | 2024-04-02 03:00:00 | 2024-04-02 03:59:59 |
|  27 |          2 |         1 | Volume Id: 1 usage time (DiskOffering: 3) |          6 |  0.2894444465637207 | 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) |          6 |                   1 | 2024-04-02 13:00:00 | 2024-04-02 13:59:59 |
|  59 |          2 |         1 | Volume Id: 2 usage time (DiskOffering: 3) |          6 |                   1 | 2024-04-02 14:00:00 | 2024-04-02 14:59:59 |
|  60 |          2 |         1 | Volume Id: 1 usage time (DiskOffering: 3) |          6 |                   1 | 2024-04-02 14:00:00 | 2024-04-02 14:59:59 |
|  62 |          2 |         1 | Volume Id: 2 usage time (DiskOffering: 3) |          6 |                   1 | 2024-04-02 15:00:00 | 2024-04-02 15:59:59 |
|  63 |          2 |         1 | Volume Id: 1 usage time (DiskOffering: 3) |          6 |                   1 | 2024-04-02 15:00:00 | 2024-04-02 15:59:59 |
|  65 |          2 |         1 | Volume Id: 2 usage time (DiskOffering: 3) |          6 |                   1 | 2024-04-02 16:00:00 | 2024-04-02 16:59:59 |
|  66 |          2 |         1 | Volume Id: 1 usage time (DiskOffering: 3) |          6 |                   1 | 2024-04-02 16:00:00 | 2024-04-02 16:59:59 |
|  68 |          2 |         1 | Volume Id: 2 usage time (DiskOffering: 3) |          6 |                   1 | 2024-04-02 17:00:00 | 2024-04-02 17:59:59 |
|  69 |          2 |         1 | Volume Id: 1 usage time (DiskOffering: 3) |          6 |                   1 | 2024-04-02 17:00:00 | 2024-04-02 17:59:59 |
|  71 |          2 |         1 | Volume Id: 2 usage time (DiskOffering: 3) |          6 |                   1 | 2024-04-02 18:00:00 | 2024-04-02 18:59:59 |
|  72 |          2 |         1 | Volume Id: 1 usage time (DiskOffering: 3) |          6 |                   1 | 2024-04-02 18:00:00 | 2024-04-02 18:59:59 |
|  74 |          2 |         1 | Volume Id: 2 usage time (DiskOffering: 3) |          6 |                   1 | 2024-04-02 19:00:00 | 2024-04-02 19:59:59 |
|  75 |          2 |         1 | Volume Id: 1 usage time (DiskOffering: 3) |          6 |                   1 | 2024-04-02 19:00:00 | 2024-04-02 19:59:59 |
|  77 |          2 |         1 | Volume Id: 2 usage time (DiskOffering: 3) |          6 |                   1 | 2024-04-02 20:00:00 | 2024-04-02 20:59:59 |
|  78 |          2 |         1 | Volume Id: 1 usage time (DiskOffering: 3) |          6 |                   1 | 2024-04-02 20:00:00 | 2024-04-02 20:59:59 |
|  80 |          2 |         1 | Volume Id: 2 usage time (DiskOffering: 3) |          6 |                   1 | 2024-04-02 21:00:00 | 2024-04-02 21:59:59 |
|  81 |          2 |         1 | Volume Id: 1 usage time (DiskOffering: 3) |          6 |                   1 | 2024-04-02 21:00:00 | 2024-04-02 21:59:59 |
|  83 |          2 |         1 | Volume Id: 2 usage time (DiskOffering: 3) |          6 |                   1 | 2024-04-02 22:00:00 | 2024-04-02 22:59:59 |
|  84 |          2 |         1 | Volume Id: 1 usage time (DiskOffering: 3) |          6 |                   1 | 2024-04-02 22:00:00 | 2024-04-02 22:59:59 |
|  86 |          2 |         1 | Volume Id: 2 usage time (DiskOffering: 3) |          6 |                   1 | 2024-04-02 23:00:00 | 2024-04-02 23:59:59 |
|  87 |          2 |         1 | Volume Id: 1 usage time (DiskOffering: 3) |          6 |                   1 | 2024-04-02 23:00:00 | 2024-04-02 23:59:59 |
|  89 |          2 |         1 | Volume Id: 2 usage time (DiskOffering: 3) |          6 |                   1 | 2024-04-03 00:00:00 | 2024-04-03 00:59:59 |
|  90 |          2 |         1 | Volume Id: 1 usage time (DiskOffering: 3) |          6 |                   1 | 2024-04-03 00:00:00 | 2024-04-03 00:59:59 |
|  92 |          2 |         1 | Volume Id: 2 usage time (DiskOffering: 3) |          6 |                   1 | 2024-04-03 01:00:00 | 2024-04-03 01:59:59 |
|  93 |          2 |         1 | Volume Id: 1 usage time (DiskOffering: 3) |          6 |                   1 | 2024-04-03 01:00:00 | 2024-04-03 01:59:59 |
|  95 |          2 |         1 | Volume Id: 2 usage time (DiskOffering: 3) |          6 |                   1 | 2024-04-03 02:00:00 | 2024-04-03 02:59:59 |
|  96 |          2 |         1 | Volume Id: 1 usage time (DiskOffering: 3) |          6 |                   1 | 2024-04-03 02:00:00 | 2024-04-03 02:59:59 |
|  98 |          2 |         1 | Volume Id: 2 usage time (DiskOffering: 3) |          6 |                   1 | 2024-04-03 03:00:00 | 2024-04-03 03:59:59 |
|  99 |          2 |         1 | Volume Id: 1 usage time (DiskOffering: 3) |          6 |                   1 | 2024-04-03 03:00:00 | 2024-04-03 03:59:59 |
| 101 |          2 |         1 | Volume Id: 2 usage time (DiskOffering: 3) |          6 |                   1 | 2024-04-03 04:00:00 | 2024-04-03 04:59:59 |
| 102 |          2 |         1 | Volume Id: 1 usage time (DiskOffering: 3) |          6 |                   1 | 2024-04-03 04:00:00 | 2024-04-03 04:59:59 |
| 104 |          2 |         1 | Volume Id: 2 usage time (DiskOffering: 3) |          6 |                   1 | 2024-04-03 05:00:00 | 2024-04-03 05:59:59 |
| 105 |          2 |         1 | Volume Id: 1 usage time (DiskOffering: 3) |          6 |                   1 | 2024-04-03 05:00:00 | 2024-04-03 05:59:59 |
| 107 |          2 |         1 | Volume Id: 2 usage time (DiskOffering: 3) |          6 |                   1 | 2024-04-03 06:00:00 | 2024-04-03 06:59:59 |
| 108 |          2 |         1 | Volume Id: 1 usage time (DiskOffering: 3) |          6 |                   1 | 2024-04-03 06:00:00 | 2024-04-03 06:59:59 |
| 110 |          2 |         1 | Volume Id: 2 usage time (DiskOffering: 3) |          6 |                   1 | 2024-04-03 07:00:00 | 2024-04-03 07:59:59 |
| 111 |          2 |         1 | Volume Id: 1 usage time (DiskOffering: 3) |          6 |                   1 | 2024-04-03 07:00:00 | 2024-04-03 07:59:59 |
| 113 |          2 |         1 | Volume Id: 2 usage time (DiskOffering: 3) |          6 |                   1 | 2024-04-03 08:00:00 | 2024-04-03 08:59:59 |
| 114 |          2 |         1 | Volume Id: 1 usage time (DiskOffering: 3) |          6 |                   1 | 2024-04-03 08:00:00 | 2024-04-03 08:59:59 |
| 116 |          2 |         1 | Volume Id: 2 usage time (DiskOffering: 3) |          6 |                   1 | 2024-04-03 09:00:00 | 2024-04-03 09:59:59 |
| 117 |          2 |         1 | Volume Id: 1 usage time (DiskOffering: 3) |          6 |                   1 | 2024-04-03 09:00:00 | 2024-04-03 09:59:59 |
| 119 |          2 |         1 | Volume Id: 2 usage time (DiskOffering: 3) |          6 |                   1 | 2024-04-03 10:00:00 | 2024-04-03 10:59:59 |
+-----+------------+-----------+-------------------------------------------+------------+---------------------+---------------------+---------------------+

In this test, I was filtering the data with a start date equal or greater to 2024-04-02T03:00:00+0000 and an end date less or equal to 2024-04-02T05:00:00+0000; therefore, I was expecting to receive the data regarding the entries with IDs 26, 27, 29 and 30.
Before applying the patch, the API returned random data, which can be noticed by the rawusage attribute that does not contain the values expected for the entries with IDs 26 and 27. Also, the attributes startdate and enddate in the response presented the expected date (2024-04-02) and time (03:00:00), according to the filter I did; however, I requested the data in UTC, and it presented a data considering the timezone configured in the global settings (GMT-5), which is pretty confusing.
listUsageRecord before applying the patch
(localcloud) 🐱 > list usagerecords accountid=2 type=6 startdate=2024-04-02T03:00:00+0000 enddate=2024-04-02T05:00:00+0000
{
  "count": 4,
  "usagerecord": [
    {
      "account": "admin",
      "accountid": "5c6b89e7-f09a-11ee-84ff-5254008551cd",
      "description": "Volume usage for test-2 (f050638c-24e2-469d-a798-567685fda3b3) with disk offering Small (7b148fcb-f2c4-4d4c-8daf-dee609034bd2) and size (5.00 GB)<PHONE_NUMBER>",
      "domain": "ROOT",
      "domainid": "49d58d3c-f09a-11ee-84ff-5254008551cd",
      "enddate": "2024-04-02'T'03:59:59-05:00",
      "offeringid": "7b148fcb-f2c4-4d4c-8daf-dee609034bd2",
      "rawusage": "1",
      "size":<PHONE_NUMBER>,
      "startdate": "2024-04-02'T'03:00:00-05:00",
      "tags": [],
      "usage": "1 Hrs",
      "usageid": "f050638c-24e2-469d-a798-567685fda3b3",
      "usagetype": 6,
      "zoneid": "b751e541-3a12-4e86-a4bc-9a06b192359a"
    },
    {
      "account": "admin",
      "accountid": "5c6b89e7-f09a-11ee-84ff-5254008551cd",
      "description": "Volume usage for test-1 (2a8d93b8-3be2-446d-bde8-a3c59b91bba0) with disk offering Small (7b148fcb-f2c4-4d4c-8daf-dee609034bd2) and size (5.00 GB)<PHONE_NUMBER>",
      "domain": "ROOT",
      "domainid": "49d58d3c-f09a-11ee-84ff-5254008551cd",
      "enddate": "2024-04-02'T'03:59:59-05:00",
      "offeringid": "7b148fcb-f2c4-4d4c-8daf-dee609034bd2",
      "rawusage": "1",
      "size":<PHONE_NUMBER>,
      "startdate": "2024-04-02'T'03:00:00-05:00",
      "tags": [],
      "usage": "1 Hrs",
      "usageid": "2a8d93b8-3be2-446d-bde8-a3c59b91bba0",
      "usagetype": 6,
      "zoneid": "b751e541-3a12-4e86-a4bc-9a06b192359a"
    },
    {
      "account": "admin",
      "accountid": "5c6b89e7-f09a-11ee-84ff-5254008551cd",
      "description": "Volume usage for test-2 (f050638c-24e2-469d-a798-567685fda3b3) with disk offering Small (7b148fcb-f2c4-4d4c-8daf-dee609034bd2) and size (5.00 GB)<PHONE_NUMBER>",
      "domain": "ROOT",
      "domainid": "49d58d3c-f09a-11ee-84ff-5254008551cd",
      "enddate": "2024-04-02'T'04:59:59-05:00",
      "offeringid": "7b148fcb-f2c4-4d4c-8daf-dee609034bd2",
      "rawusage": "1",
      "size":<PHONE_NUMBER>,
      "startdate": "2024-04-02'T'04:00:00-05:00",
      "tags": [],
      "usage": "1 Hrs",
      "usageid": "f050638c-24e2-469d-a798-567685fda3b3",
      "usagetype": 6,
      "zoneid": "b751e541-3a12-4e86-a4bc-9a06b192359a"
    },
    {
      "account": "admin",
      "accountid": "5c6b89e7-f09a-11ee-84ff-5254008551cd",
      "description": "Volume usage for test-1 (2a8d93b8-3be2-446d-bde8-a3c59b91bba0) with disk offering Small (7b148fcb-f2c4-4d4c-8daf-dee609034bd2) and size (5.00 GB)<PHONE_NUMBER>",
      "domain": "ROOT",
      "domainid": "49d58d3c-f09a-11ee-84ff-5254008551cd",
      "enddate": "2024-04-02'T'04:59:59-05:00",
      "offeringid": "7b148fcb-f2c4-4d4c-8daf-dee609034bd2",
      "rawusage": "1",
      "size":<PHONE_NUMBER>,
      "startdate": "2024-04-02'T'04:00:00-05:00",
      "tags": [],
      "usage": "1 Hrs",
      "usageid": "2a8d93b8-3be2-446d-bde8-a3c59b91bba0",
      "usagetype": 6,
      "zoneid": "b751e541-3a12-4e86-a4bc-9a06b192359a"
    }
  ]
}

After applying the patch, the API returned the correct data, which can be noticed by the rawusage attribute that contain the values expected for the entries with IDs 26 and 27. The attributes startdate and enddate in the response present  the expected date and time; however, in the timezone of the server. The response should present the data in UTC, not in the server timezone (Adjustment 1).
listUsageRecord after applying the patch
(localcloud) 🐱 > list usagerecords accountid=2 type=6 startdate=2024-04-02T03:00:00+0000 enddate=2024-04-02T05:00:00+0000
{
  "count": 4,
  "usagerecord": [
    {
      "account": "admin",
      "accountid": "5c6b89e7-f09a-11ee-84ff-5254008551cd",
      "description": "Volume usage for test-2 (f050638c-24e2-469d-a798-567685fda3b3) with disk offering Small (7b148fcb-f2c4-4d4c-8daf-dee609034bd2) and size (5.00 GB)<PHONE_NUMBER>",
      "domain": "ROOT",
      "domainid": "49d58d3c-f09a-11ee-84ff-5254008551cd",
      "enddate": "2024-04-02T00:59:59-0300",
      "offeringid": "7b148fcb-f2c4-4d4c-8daf-dee609034bd2",
      "rawusage": "0.241111",
      "size":<PHONE_NUMBER>,
      "startdate": "2024-04-02T00:00:00-0300",
      "tags": [],
      "usage": "0.241111 Hrs",
      "usageid": "f050638c-24e2-469d-a798-567685fda3b3",
      "usagetype": 6,
      "zoneid": "b751e541-3a12-4e86-a4bc-9a06b192359a"
    },
    {
      "account": "admin",
      "accountid": "5c6b89e7-f09a-11ee-84ff-5254008551cd",
      "description": "Volume usage for test-1 (2a8d93b8-3be2-446d-bde8-a3c59b91bba0) with disk offering Small (7b148fcb-f2c4-4d4c-8daf-dee609034bd2) and size (5.00 GB)<PHONE_NUMBER>",
      "domain": "ROOT",
      "domainid": "49d58d3c-f09a-11ee-84ff-5254008551cd",
      "enddate": "2024-04-02T00:59:59-0300",
      "offeringid": "7b148fcb-f2c4-4d4c-8daf-dee609034bd2",
      "rawusage": "0.289444",
      "size":<PHONE_NUMBER>,
      "startdate": "2024-04-02T00:00:00-0300",
      "tags": [],
      "usage": "0.289444 Hrs",
      "usageid": "2a8d93b8-3be2-446d-bde8-a3c59b91bba0",
      "usagetype": 6,
      "zoneid": "b751e541-3a12-4e86-a4bc-9a06b192359a"
    },
    {
      "account": "admin",
      "accountid": "5c6b89e7-f09a-11ee-84ff-5254008551cd",
      "description": "Volume usage for test-2 (f050638c-24e2-469d-a798-567685fda3b3) with disk offering Small (7b148fcb-f2c4-4d4c-8daf-dee609034bd2) and size (5.00 GB)<PHONE_NUMBER>",
      "domain": "ROOT",
      "domainid": "49d58d3c-f09a-11ee-84ff-5254008551cd",
      "enddate": "2024-04-02T01:59:59-0300",
      "offeringid": "7b148fcb-f2c4-4d4c-8daf-dee609034bd2",
      "rawusage": "1",
      "size":<PHONE_NUMBER>,
      "startdate": "2024-04-02T01:00:00-0300",
      "tags": [],
      "usage": "1 Hrs",
      "usageid": "f050638c-24e2-469d-a798-567685fda3b3",
      "usagetype": 6,
      "zoneid": "b751e541-3a12-4e86-a4bc-9a06b192359a"
    },
    {
      "account": "admin",
      "accountid": "5c6b89e7-f09a-11ee-84ff-5254008551cd",
      "description": "Volume usage for test-1 (2a8d93b8-3be2-446d-bde8-a3c59b91bba0) with disk offering Small (7b148fcb-f2c4-4d4c-8daf-dee609034bd2) and size (5.00 GB)<PHONE_NUMBER>",
      "domain": "ROOT",
      "domainid": "49d58d3c-f09a-11ee-84ff-5254008551cd",
      "enddate": "2024-04-02T01:59:59-0300",
      "offeringid": "7b148fcb-f2c4-4d4c-8daf-dee609034bd2",
      "rawusage": "1",
      "size":<PHONE_NUMBER>,
      "startdate": "2024-04-02T01:00:00-0300",
      "tags": [],
      "usage": "1 Hrs",
      "usageid": "2a8d93b8-3be2-446d-bde8-a3c59b91bba0",
      "usagetype": 6,
      "zoneid": "b751e541-3a12-4e86-a4bc-9a06b192359a"
    }
  ]
}

quotaStatement and quotaBalance
@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?
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).
    public Date getEndDate() {
        return _responseBuilder.startOfNextDay(endDate == null ? new Date() : new Date(endDate.getTime()));
    }

quotaCredits
Before applying the patch, I added credits to an account and ACS added the credits in the future. The response returned the correct value; however, it was in the future in the database:

API call
(localcloud) 🐱 > quota credits account=admin value=50 domainid=49d58d3c-f09a-11ee-84ff-5254008551cd
{
  "quotacredits": {
    "credits": 50,
    "currency": "$",
    "updated_by": "admin",
    "updated_on": "2024-04-05T01:27:08+0000"
  }
}

database
MariaDB [cloud_usage]> select now();
+---------------------+
| now()               |
+---------------------+
| 2024-04-05 01:31:43 |
+---------------------+
1 row in set (0.000 sec)

MariaDB [cloud_usage]> select * from quota_credits;
+----+------------+-----------+---------+---------------------+------------+
| id | account_id | domain_id | credit  | updated_on          | updated_by |
+----+------------+-----------+---------+---------------------+------------+
|  1 |          2 |         1 | 50.0000 | 2024-04-05 06:27:08 |          2 |
+----+------------+-----------+---------+---------------------+------------+
1 row in set (0.000 sec)

After applying the patch, I added credits to an account and ACS added the credits correctly. However, the response presented the data in the timezone of the server. The response should present the data in UTC, not in the server timezone (Adjustment 3).

API call
(localcloud) 🐱 > quota credits account=admin value=50 domainid=49d58d3c-f09a-11ee-84ff-5254008551cd
{
  "quotacredits": {
    "credits": 50,
    "currency": "$",
    "updated_by": "admin",
    "updated_on": "2024-04-04T23:07:44-0300"
  }
}

database
MariaDB [cloud_usage]> select * from quota_credits;
+----+------------+-----------+---------+---------------------+------------+
| id | account_id | domain_id | credit  | updated_on          | updated_by |
+----+------------+-----------+---------+---------------------+------------+
|  1 |          2 |         1 | 50.0000 | 2024-04-05 06:27:08 |          2 |
|  2 |          2 |         1 | 50.0000 | 2024-04-05 02:07:44 |          2 |
+----+------------+-----------+---------+---------------------+------------+
2 rows in set (0.000 sec)

MariaDB [cloud_usage]> select now();
+---------------------+
| now()               |
+---------------------+
| 2024-04-05 02:08:07 |
+---------------------+
1 row in set (0.000 sec)

quotaTariffCreate
Before applying the patch, I created a tariff passing some values in UTC to startdate and enddate. The response returned different data than the values passed as parameters and the database was also wrong:

API call
(localcloud) 🐱 > quota tariffcreate name=before startdate=2024-04-05T03:00:00+0000 enddate=2024-04-05T06:00:00+0000 usagetype=6 value=40
{
  "quotatariff": {
    "currency": "$",
    "effectiveDate": "2024-04-05T08:00:00+0000",
    "endDate": "2024-04-05T11:00:00+0000",
    "name": "before",
    "tariffValue": 40,
    "usageDiscriminator": "None",
    "usageName": "VOLUME",
    "usageType": 6,
    "usageTypeDescription": "Volume Usage",
    "usageUnit": "GB*Month",
    "uuid": "170f5b1b-ba17-415b-86a0-af6ebd58e5a5"
  }
}

database
MariaDB [cloud_usage]> select * from quota_tariff where name = 'before';
+----+------------+------------+------------+---------------------+----------------+---------------------+---------------------+------------+--------------------------------------+--------+-------------+-----------------+---------+---------------------+
| id | usage_type | usage_name | usage_unit | usage_discriminator | currency_value | effective_on        | updated_on          | updated_by | uuid                                 | name   | description | activation_rule | removed | end_date            |
+----+------------+------------+------------+---------------------+----------------+---------------------+---------------------+------------+--------------------------------------+--------+-------------+-----------------+---------+---------------------+
| 24 |          6 | VOLUME     | GB*Month   | None                |       40.00000 | 2024-04-05 08:00:00 | 2024-04-05 08:00:00 |          1 | 170f5b1b-ba17-415b-86a0-af6ebd58e5a5 | before | NULL        | NULL            | NULL    | 2024-04-05 11:00:00 |
+----+------------+------------+------------+---------------------+----------------+---------------------+---------------------+------------+--------------------------------------+--------+-------------+-----------------+---------+---------------------+

After applying the patch, I created a tariff passing some values in UTC to startdate and enddate. The tariff was created correctly; however, the response presented the data in the timezone of the server. The response should present the data in UTC, not in the server timezone (Adjustment 4).

API call
(localcloud) 🐱 > quota tariffcreate name=after startdate=2024-04-05T03:00:00+0000 enddate=2024-04-05T06:00:00+0000 usagetype=6 value=40
{
  "quotatariff": {
    "currency": "$",
    "effectiveDate": "2024-04-05T00:00:00-0300",
    "endDate": "2024-04-05T03:00:00-0300",
    "id": "46a2fd8d-a6d1-415e-b2f0-e62d6ad816bf",
    "name": "after",
    "tariffValue": 40,
    "usageDiscriminator": "None",
    "usageName": "VOLUME",
    "usageType": 6,
    "usageTypeDescription": "Volume Usage",
    "usageUnit": "GB*Month"
  }
}

database
MariaDB [cloud_usage]> select * from quota_tariff where name = 'after';
+----+------------+------------+------------+---------------------+----------------+---------------------+---------------------+------------+--------------------------------------+-------+-------------+-----------------+---------+---------------------+
| id | usage_type | usage_name | usage_unit | usage_discriminator | currency_value | effective_on        | updated_on          | updated_by | uuid                                 | name  | description | activation_rule | removed | end_date            |
+----+------------+------------+------------+---------------------+----------------+---------------------+---------------------+------------+--------------------------------------+-------+-------------+-----------------+---------+---------------------+
| 26 |          6 | VOLUME     | GB*Month   | None                |       40.00000 | 2024-04-05 03:00:00 | 2024-04-05 03:00:00 |          1 | 46a2fd8d-a6d1-415e-b2f0-e62d6ad816bf | after | NULL        | NULL            | NULL    | 2024-04-05 06:00:00 |
+----+------------+------------+------------+---------------------+----------------+---------------------+---------------------+------------+--------------------------------------+-------+-------------+-----------------+---------+---------------------+
1 row in set (0.000 sec)

quotaTariffList
Before applying the patch, I tried to list the tariff I created in the test before. The filtered the tariff by startdate according to how it was in the database; however, no data was returned:
(localcloud) 🐱 > quota tarifflist startdate='2024-04-05T08:00:00+0000'
(localcloud) 🐱 >

After applying the patch, I did the same filter and now it returned the correct data. However, the response presented the data in the timezone of the server. The response should present the data in UTC, not in the server timezone (Adjustment 5).
(localcloud) 🐱 > quota tarifflist startdate='2024-04-05T08:00:00+0000'
{
  "count": 1,
  "quotatariff": [
    {
      "currency": "$",
      "effectiveDate": "2024-04-05T05:00:00-0300",
      "endDate": "2024-04-05T09:00:00-0300",
      "id": "60b8769f-2daa-4ae5-bce0-acb4c766807a",
      "name": "before",
      "tariffValue": 40,
      "usageDiscriminator": "None",
      "usageName": "VOLUME",
      "usageType": 6,
      "usageTypeDescription": "Volume Usage",
      "usageUnit": "GB*Month"
    }
  ]

quotaTariffUpdate
Before applying the patch, I updated the enddate of my first tariff. The response returned  different data than the values passed as parameters and the database was also wrong:

API call
(localcloud) 🐱 > quota tariffupdate name=before enddate=2024-04-05T07:00:00+0000
{
  "quotatariff": {
    "currency": "$",
    "effectiveDate": "2024-04-05T08:00:00+0000",
    "endDate": "2024-04-05T12:00:00+0000",
    "name": "before",
    "tariffValue": 40,
    "usageDiscriminator": "None",
    "usageName": "VOLUME",
    "usageType": 6,
    "usageTypeDescription": "Volume Usage",
    "usageUnit": "GB*Month",
    "uuid": "60b8769f-2daa-4ae5-bce0-acb4c766807a"
  }
}

database
MariaDB [cloud_usage]> select * from quota_tariff where name = 'before';
+----+------------+------------+------------+---------------------+----------------+---------------------+---------------------+------------+--------------------------------------+--------+-------------+-----------------+---------------------+---------------------+
| id | usage_type | usage_name | usage_unit | usage_discriminator | currency_value | effective_on        | updated_on          | updated_by | uuid                                 | name   | description | activation_rule | removed             | end_date            |
+----+------------+------------+------------+---------------------+----------------+---------------------+---------------------+------------+--------------------------------------+--------+-------------+-----------------+---------------------+---------------------+
| 24 |          6 | VOLUME     | GB*Month   | None                |       40.00000 | 2024-04-05 08:00:00 | 2024-04-05 08:00:00 |          1 | 170f5b1b-ba17-415b-86a0-af6ebd58e5a5 | before | NULL        | NULL            | 2024-04-05 06:40:57 | 2024-04-05 11:00:00 |
| 25 |          6 | VOLUME     | GB*Month   | None                |       40.00000 | 2024-04-05 08:00:00 | 2024-04-05 08:00:00 |          1 | 60b8769f-2daa-4ae5-bce0-acb4c766807a | before | NULL        | NULL            | NULL                | 2024-04-05 12:00:00 |
+----+------------+------------+------------+---------------------+----------------+---------------------+---------------------+------------+--------------------------------------+--------+-------------+-----------------+---------------------+---------------------+

After applying the patch, I updated the enddate of my second tariff. The tariff was updated correctly; however, the response presented the data in the timezone of the server. The response should present the data in UTC, not in the server timezone (Adjustment 6).

API call
(localcloud) 🐱 > quota tariffupdate name=after enddate=2024-04-05T07:00:00+0000
{
  "quotatariff": {
    "currency": "$",
    "effectiveDate": "2024-04-05T00:00:00-0300",
    "endDate": "2024-04-05T04:00:00-0300",
    "id": "fe0ee347-7f02-4933-a8af-c656ced6c488",
    "name": "after",
    "tariffValue": 40,
    "usageDiscriminator": "None",
    "usageName": "VOLUME",
    "usageType": 6,
    "usageTypeDescription": "Volume Usage",
    "usageUnit": "GB*Month"
  }
}

database
MariaDB [cloud_usage]> select * from quota_tariff where name = 'after';
+----+------------+------------+------------+---------------------+----------------+---------------------+---------------------+------------+--------------------------------------+-------+-------------+-----------------+---------------------+---------------------+
| id | usage_type | usage_name | usage_unit | usage_discriminator | currency_value | effective_on        | updated_on          | updated_by | uuid                                 | name  | description | activation_rule | removed             | end_date            |
+----+------------+------------+------------+---------------------+----------------+---------------------+---------------------+------------+--------------------------------------+-------+-------------+-----------------+---------------------+---------------------+
| 26 |          6 | VOLUME     | GB*Month   | None                |       40.00000 | 2024-04-05 03:00:00 | 2024-04-05 03:00:00 |          1 | 46a2fd8d-a6d1-415e-b2f0-e62d6ad816bf | after | NULL        | NULL            | 2024-04-05 02:18:18 | 2024-04-05 06:00:00 |
| 27 |          6 | VOLUME     | GB*Month   | None                |       40.00000 | 2024-04-05 03:00:00 | 2024-04-05 03:00:00 |          1 | fe0ee347-7f02-4933-a8af-c656ced6c488 | after | NULL        | NULL            | NULL                | 2024-04-05 07:00:00 |
+----+------------+------------+------------+---------------------+----------------+---------------------+---------------------+------------+--------------------------------------+-------+-------------+-----------------+---------------------+---------------------+

quotaTariffDelete
@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?

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

quite some q&a 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.

@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:
-        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:
-            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:
-        quotaTariff.setRemoved(_quotaService.computeAdjustedTime(new Date()));
+        quotaTariff.setRemoved(new Date());

@blueorangutan package

@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.

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