File tree Expand file tree Collapse file tree 9 files changed +39
-7
lines changed
framework/quota/src/main/java/org/apache/cloudstack/quota
plugins/database/quota/src/main/java/org/apache/cloudstack/api/command Expand file tree Collapse file tree 9 files changed +39
-7
lines changed Original file line number Diff line number Diff line change 2929import org .apache .cloudstack .api .response .ZoneResponse ;
3030import org .apache .cloudstack .config .Configuration ;
3131import org .apache .cloudstack .ha .HAConfig ;
32+ import org .apache .cloudstack .quota .QuotaTariff ;
3233import org .apache .cloudstack .storage .object .Bucket ;
3334import org .apache .cloudstack .storage .object .ObjectStore ;
3435import org .apache .cloudstack .usage .Usage ;
@@ -1182,9 +1183,9 @@ public class EventTypes {
11821183 entityEventDetails .put (EVENT_BUCKET_DELETE , Bucket .class );
11831184
11841185 // Quota
1185- entityEventDetails .put (EVENT_QUOTA_TARIFF_CREATE , " QuotaTariff" );
1186- entityEventDetails .put (EVENT_QUOTA_TARIFF_DELETE , " QuotaTariff" );
1187- entityEventDetails .put (EVENT_QUOTA_TARIFF_UPDATE , " QuotaTariff" );
1186+ entityEventDetails .put (EVENT_QUOTA_TARIFF_CREATE , QuotaTariff . class );
1187+ entityEventDetails .put (EVENT_QUOTA_TARIFF_DELETE , QuotaTariff . class );
1188+ entityEventDetails .put (EVENT_QUOTA_TARIFF_UPDATE , QuotaTariff . class );
11881189 }
11891190
11901191 public static String getEntityForEvent (String eventName ) {
Original file line number Diff line number Diff line change @@ -80,7 +80,8 @@ public enum ApiCommandResourceType {
8080 VpnCustomerGateway (com .cloud .network .Site2SiteCustomerGateway .class ),
8181 ManagementServer (org .apache .cloudstack .management .ManagementServerHost .class ),
8282 ObjectStore (org .apache .cloudstack .storage .object .ObjectStore .class ),
83- Bucket (org .apache .cloudstack .storage .object .Bucket .class );
83+ Bucket (org .apache .cloudstack .storage .object .Bucket .class ),
84+ QuotaTariff (org .apache .cloudstack .quota .QuotaTariff .class );
8485
8586 private final Class <?> clazz ;
8687
Original file line number Diff line number Diff line change 1+ package org .apache .cloudstack .quota ;
2+
3+ import org .apache .cloudstack .api .InternalIdentity ;
4+
5+ public interface QuotaTariff extends InternalIdentity {
6+
7+ }
Original file line number Diff line number Diff line change @@ -231,4 +231,9 @@ public QuotaTariffVO findByUuid(String uuid) {
231231
232232 return quotaTariffs .get (0 );
233233 }
234+
235+ @ Override
236+ public QuotaTariffVO findByIdIncludingRemoved (Long id ) {
237+ return Transaction .execute (TransactionLegacy .USAGE_DB , (TransactionCallback <QuotaTariffVO >) status -> super .findByIdIncludingRemoved (id ));
238+ }
234239}
Original file line number Diff line number Diff line change 1616//under the License.
1717package org .apache .cloudstack .quota .vo ;
1818
19- import org .apache .cloudstack .api . InternalIdentity ;
19+ import org .apache .cloudstack .quota . QuotaTariff ;
2020import org .apache .cloudstack .quota .constant .QuotaTypes ;
2121import org .apache .cloudstack .utils .reflectiontostringbuilderutils .ReflectionToStringBuilderUtils ;
2222
3737
3838@ Entity
3939@ Table (name = "quota_tariff" )
40- public class QuotaTariffVO implements InternalIdentity {
40+ public class QuotaTariffVO implements QuotaTariff {
4141 private static final long serialVersionUID = -7117933766387653203L ;
4242
4343 @ Id
Original file line number Diff line number Diff line change 2020
2121import org .apache .cloudstack .acl .RoleType ;
2222import org .apache .cloudstack .api .APICommand ;
23+ import org .apache .cloudstack .api .ApiCommandResourceType ;
2324import org .apache .cloudstack .api .ApiConstants ;
2425import org .apache .cloudstack .api .ApiErrorCode ;
2526import org .apache .cloudstack .api .BaseCmd ;
@@ -135,4 +136,9 @@ public Date getEndDate() {
135136 public void setEndDate (Date endDate ) {
136137 this .endDate = endDate ;
137138 }
139+
140+ @ Override
141+ public ApiCommandResourceType getApiResourceType () {
142+ return ApiCommandResourceType .QuotaTariff ;
143+ }
138144}
Original file line number Diff line number Diff line change 2121import org .apache .cloudstack .acl .RoleType ;
2222import org .apache .cloudstack .api .APICommand ;
2323import org .apache .cloudstack .api .ApiArgValidator ;
24+ import org .apache .cloudstack .api .ApiCommandResourceType ;
2425import org .apache .cloudstack .api .ApiConstants ;
2526import org .apache .cloudstack .api .BaseCmd ;
2627import org .apache .cloudstack .api .Parameter ;
@@ -61,4 +62,9 @@ public void execute() {
6162 public long getEntityOwnerId () {
6263 return Account .ACCOUNT_ID_SYSTEM ;
6364 }
65+
66+ @ Override
67+ public ApiCommandResourceType getApiResourceType () {
68+ return ApiCommandResourceType .QuotaTariff ;
69+ }
6470}
Original file line number Diff line number Diff line change 2020
2121import org .apache .cloudstack .acl .RoleType ;
2222import org .apache .cloudstack .api .APICommand ;
23+ import org .apache .cloudstack .api .ApiCommandResourceType ;
2324import org .apache .cloudstack .api .ApiConstants ;
2425import org .apache .cloudstack .api .ApiErrorCode ;
2526import org .apache .cloudstack .api .BaseCmd ;
@@ -127,4 +128,8 @@ public long getEntityOwnerId() {
127128 return Account .ACCOUNT_ID_SYSTEM ;
128129 }
129130
131+ @ Override
132+ public ApiCommandResourceType getApiResourceType () {
133+ return ApiCommandResourceType .QuotaTariff ;
134+ }
130135}
Original file line number Diff line number Diff line change @@ -339,7 +339,8 @@ export default {
339339 { value: ' Template' },
340340 { value: ' User' },
341341 { value: ' VirtualMachine' },
342- { value: ' Volume' }
342+ { value: ' Volume' },
343+ { value: ' QuotaTariff' }
343344 ]
344345 this .fields [resourceTypeIndex].loading = false
345346 }
You can’t perform that action at this time.
0 commit comments