RosiKyu commented on PR #12539:
URL: https://github.com/apache/cloudstack/pull/12539#issuecomment-3823508648

   @abh1sar , tested with the last changes. The `size` and `virtualsize` fields 
are now correctly included in the `listUsageRecords` API response for usage 
type 28 (Backup), along with an updated description format showing both size 
values.
   
   
   ### API Response Verification
   
   - Created VM with backup offering assigned
   - Created backup for the VM
   - Waited for usage aggregation to process backup usage events
   
   ```
   (localcloud) 🐱 > listUsageRecords usagetype=28 startdate=2026-01-30 
enddate=2026-01-31 account=admin | python3 -c "import sys,json; 
d=json.load(sys.stdin); print(json.dumps([r for r in d.get('usagerecord',[]) if 
r.get('usagetype')==28][-1], indent=2))"
   {
     "account": "admin",
     "accountid": "61127bf6-fd41-11f0-98c7-1e00370002e0",
     "description": "Backup usage for VM backup-test-vm 
(8367f058-03de-4d85-9250-2d4ac1ca5f66) and backup offering test 
(bcc29bb8-b727-4fc1-abbe-e3a3d7899d69, user ad-hoc/scheduled backup allowed: 
true) with size (1000 bytes) 1000 and with virtual size (100 bytes) 100",
     "domain": "ROOT",
     "domainid": "1db1a70d-fd41-11f0-98c7-1e00370002e0",
     "domainpath": "/",
     "enddate": "2026-01-30T12:16:59+0000",
     "name": "i-2-3-VM",
     "rawusage": "0.25",
     "size": 1000,
     "startdate": "2026-01-30T12:02:00+0000",
     "tags": [],
     "usage": "0.25 Hrs",
     "usageid": "8367f058-03de-4d85-9250-2d4ac1ca5f66",
     "usagetype": 28,
     "virtualmachineid": "8367f058-03de-4d85-9250-2d4ac1ca5f66",
     "virtualsize": 100,
     "zoneid": "bdb1d48b-6c33-4484-882c-a0b61d4887c9"
   }
   ```


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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to