-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Milestone
Description
According to CloudStack API description:
https://cloudstack.apache.org/api/apidocs-4.17/apis/generateUsageRecords.html
Generates usage records. This will generate records only if there any records to be generated, i.e if the scheduled usage job was not run or failed
startdate and enddate are required parameters of the API. However, both seem not used (and domainid as well).
cloudstack/server/src/main/java/com/cloud/usage/UsageServiceImpl.java
Lines 140 to 164 in d288bb0
| @Override | |
| public boolean generateUsageRecords(GenerateUsageRecordsCmd cmd) { | |
| TransactionLegacy txn = TransactionLegacy.open(TransactionLegacy.USAGE_DB); | |
| try { | |
| UsageJobVO immediateJob = _usageJobDao.getNextImmediateJob(); | |
| if (immediateJob == null) { | |
| UsageJobVO job = _usageJobDao.getLastJob(); | |
| String host = null; | |
| int pid = 0; | |
| if (job != null) { | |
| host = job.getHost(); | |
| pid = ((job.getPid() == null) ? 0 : job.getPid().intValue()); | |
| } | |
| _usageJobDao.createNewJob(host, pid, UsageJobVO.JOB_TYPE_SINGLE); | |
| } | |
| } finally { | |
| txn.close(); | |
| // switch back to VMOPS_DB | |
| TransactionLegacy swap = TransactionLegacy.open(TransactionLegacy.CLOUD_DB); | |
| swap.close(); | |
| } | |
| return true; | |
| } |
ISSUE TYPE
- Bug Report
COMPONENT NAME
Usage
CLOUDSTACK VERSION
4.18
CONFIGURATION
OS / ENVIRONMENT
SUMMARY
STEPS TO REPRODUCE
EXPECTED RESULTS
ACTUAL RESULTS