Commit Graph

334 Commits

Author SHA1 Message Date
Abhinandan Prateek 4d911fc3b7 QUOTA: fix admin account check, add debug info for serv ice offering, mv
credit entry check to a boolena method
2015-12-18 18:32:35 +05:30
Abhinandan Prateek 3b18d74be6 CLOUDSTACK-9174: A deleted account results in NPE
When an account is deleted from cloudstack for which quota is still
being calculated and if the quota reaches minimum threshold then
quota service will try to alert the user. This results in NPE and is
fixed by excluding such accounts from alerting and other quota related
mechanisms.
2015-12-17 11:12:25 +05:30
Abhinandan Prateek 5bead93672 CLOUDSTACK-9161: fix the quota marvin test
1. Create a dummy user, as existing user may already have stale quota
  data
  2. fix the tests to use the dummy user
  3. a boundary condition was revealed and fixed for a new user where
  quota service has never run and created bootstrap entries
2015-12-14 15:30:41 +05:30
Abhinandan Prateek ec830d459b Quota: future credit netries should be incorporated when the balance is
calculated
2015-12-08 17:21:00 +05:30
Abhinandan Prateek 068f97ad60 QUOTA: On a rerun the last balance is now getting added 2015-12-07 22:26:56 +05:30
Abhinandan Prateek 07fce097fe quota review fixes 2015-12-07 15:45:09 +05:30
Abhinandan Prateek 88266eb221 quota review fixes 2015-12-07 15:45:01 +05:30
Abhinandan Prateek 6716c9ab58 Quota review fixes 2015-12-07 13:43:07 +05:30
Abhinandan Prateek 58b3769590 QUOTA REVIEW FIXES
Removing tests for start and stop as there is no logic there to test
2015-12-07 12:26:57 +05:30
Abhinandan Prateek f08a3ee824 QUOTA REVIEW FIXES
1. reveiw fixes
       2. cleaning hardcoded text from quota.js
       3. fixed test cases
2015-12-07 12:04:35 +05:30
Abhinandan Prateek 0151cda7dd CLOUDSTACK-8592: optimization and fixes
1. Process usage entries that have greater than 0 usage
    2. Process quota entries only if tariff is non zero
    3. If there are credit entries but no balance entry create a dummy
    balance entry
    4. Remove any credit entries that are before the last balance entry
    when displaying balance statement
    5. Bug: write the balance entry, boundary condition
2015-12-05 17:37:11 +05:30
Abhinandan Prateek 35bbd4b692 CLOUDSTACK-8592: making API more UI friendly 2015-12-03 17:13:26 +05:30
Abhinandan Prateek 98c8862a75 CLOUDSTACK-8592: merge fixes 2015-11-27 18:22:20 +05:30
Abhinandan Prateek 363cd8c9d8 CLOUDSTACK-8592: add dummy quota entry of 0 quota use if no quota entries exist for a period 2015-11-16 09:42:25 +05:30
Abhinandan Prateek 4b249bde43 CLOUDSTACK-8592: quota alert test cases are moved to QuotaAlertManagerImplTest 2015-11-09 11:35:37 +05:30
Abhinandan Prateek db3c1bbd79 CLOUDSTACK-8592: Report quotaSummary command returns quota balance, quota usage and
state for all account.
2015-11-05 14:19:16 +05:30
Abhinandan Prateek b4462dc3fd CLOUDSTACK-8592: adding balance summary report 2015-11-04 17:41:20 +05:30
Abhinandan Prateek 625406b48f CLOUDSTACK-8592: adding more test, fine tuning 0 quota conditions. 2015-11-04 11:23:13 +05:30
Abhinandan Prateek 3102dbc59f CLOUDSTACK-8592: Making statement period configurable 2015-11-03 20:35:47 +05:30
Abhinandan Prateek c4c7609667 CLOUDSTACK-8592: Restructuring 2015-11-03 20:35:41 +05:30
Rohit Yadav 8f816e70f0 quotatypes: fix NPE issue
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-10-30 12:23:49 +05:30
Abhinandan Prateek b3592b2073 CLOUDSTACK-8592: bootstrapping the balance entries 2015-10-29 19:18:09 +05:30
Abhinandan Prateek 5161da6abf CLOUDSTACK-8592: misc fixes, mainly related to review comments on db
transactions
2015-10-29 12:40:17 +05:30
Abhinandan Prateek 75ea734809 CLOUDSTACK-8592: safer handling of transaction 2015-10-24 18:26:16 +05:30
Abhinandan Prateek 59d99915bb CLOUDSTACK-8592: removing use of deprecated methods 2015-10-21 14:47:09 +05:30
Abhinandan Prateek c3364324e6 CLOUDSTACK-8592: further review fixes 2015-10-21 14:27:05 +05:30
Abhinandan Prateek 6c246acc16 CLOUDSTACK-8592: fixed various Quota*DaoImpls to use the new Transaction
callback mechanism
2015-10-21 14:26:50 +05:30
Abhinandan Prateek cb0fde68f8 CLOUDSTACK-8592: fixed QuotaBalanceDaoImpl to use the new Transaction 2015-10-21 14:26:35 +05:30
Abhinandan Prateek 86e2e279a7 CLOUDSTACK-8592: fixed QuotaTariffDao to use the new Transaction
callback pattern
2015-10-21 14:26:05 +05:30
Abhinandan Prateek f6c1073106 CLOUDSTACK-8592: Added database switch to Transaction and fixed
QuotaTariffDao to use the callback.
2015-10-21 14:25:55 +05:30
Abhinandan Prateek 677564f7ee CLOUDSTACK-8592: fix sort order for tariff 2015-10-21 14:25:37 +05:30
Abhinandan Prateek 722805e418 CLOUDSTACK-8592: Incorporating PR changes for quota plugin 2015-10-21 14:25:13 +05:30
Rohit Yadav 7a228f66d2 CLOUDSTACK-8592: Incorporate changes from PR in quota framework and plugin
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-10-21 14:24:59 +05:30
Rohit Yadav 892a6ebbe5 CLOUDSTACK-8592: Add more unit tests
- unit tests for UsageTypes
- unit tests for all Cmd classes
- unit tests for all service and manager impls
- try-catch-finally or try-with-resource in dao impls for failsafe db switching
- remove dead code
- add missing quota calculation case (regression fixed)
- replace tabs with spaces in pom.xmls

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-10-21 14:22:53 +05:30
Abhinandan Prateek 9808321cf3 CLOUDSTACK-8592: Add changes from review
- added marvin test for quota plugin API
- removed unused commented code
- debug messages in debug enabled check
- checks for nulls, fixed access to member variables and feature
- changes based on PR comments
2015-10-21 14:22:37 +05:30
Abhinandan Prateek 43c893cc31 quota: by default make the global quota enforement flag as false. fix
the condition so that the uasage generated records are picked up in
quota calc cycle
2015-08-07 12:34:18 +05:30
Rohit Yadav 74c34d797a quota;e2etesting
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-08-07 10:58:36 +05:30
Rohit Yadav bf5d388d91 quota: check if quota is enabled, only then expose APIs
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-08-07 10:58:36 +05:30
Abhinandan Prateek 731d9b80d6 quota: +send last month statement at the start of the month 2015-08-05 14:29:19 +05:30
Abhinandan Prateek f0467c8a2b quota: streamlined emailing 2015-08-04 16:24:14 +05:30
Abhinandan Prateek 173f6ba730 quota:fixes 2015-08-04 11:45:25 +05:30
Abhinandan Prateek b38f73805a quota: added checks for quota enforce and threshold per account 2015-08-04 10:29:33 +05:30
Abhinandan Prateek b0a8598c3c quota: even if there is no usage for some resources show them in the
statement.
2015-08-03 13:32:00 +05:30
Abhinandan Prateek bd1d12d830 quota: added min_balance and quota enforce for each account 2015-08-03 09:42:39 +05:30
Abhinandan Prateek 92269d2636 quota: fixing warped up db 2015-08-01 22:12:34 +05:30
Abhinandan Prateek eaf3d21b55 quota: tariff fix 2015-08-01 18:57:54 +05:30
Abhinandan Prateek 5535e81c8b quota: fixing account bean 2015-08-01 16:13:30 +05:30
Abhinandan Prateek 9deed58fad quota: added quota_account 2015-07-31 17:39:14 +05:30
Abhinandan Prateek 8c81b02d9e quota: fine tuning dates 2015-07-31 12:42:35 +05:30
Abhinandan Prateek 50c579de3d quota: restructured/refactored to make quota run inside the usage server 2015-07-30 16:40:39 +05:30