3030import com .cloud .offering .DiskOffering ;
3131import com .cloud .offering .ServiceOffering ;
3232import com .cloud .template .VirtualMachineTemplate ;
33+ import org .apache .cloudstack .resourcelimit .Reserver ;
3334
3435public interface ResourceLimitService {
3536
@@ -193,6 +194,7 @@ public interface ResourceLimitService {
193194 */
194195 public void checkResourceLimit (Account account , ResourceCount .ResourceType type , long ... count ) throws ResourceAllocationException ;
195196 public void checkResourceLimitWithTag (Account account , ResourceCount .ResourceType type , String tag , long ... count ) throws ResourceAllocationException ;
197+ public void checkResourceLimitWithTag (Account account , Long domainId , boolean considerSystemAccount , ResourceCount .ResourceType type , String tag , long ... count ) throws ResourceAllocationException ;
196198
197199 /**
198200 * Gets the count of resources for a resource type and account
@@ -253,12 +255,12 @@ public interface ResourceLimitService {
253255 List <String > getResourceLimitStorageTags (DiskOffering diskOffering );
254256 void updateTaggedResourceLimitsAndCountsForAccounts (List <AccountResponse > responses , String tag );
255257 void updateTaggedResourceLimitsAndCountsForDomains (List <DomainResponse > responses , String tag );
256- void checkVolumeResourceLimit (Account owner , Boolean display , Long size , DiskOffering diskOffering ) throws ResourceAllocationException ;
257-
258+ void checkVolumeResourceLimit (Account owner , Boolean display , Long size , DiskOffering diskOffering , List < Reserver > reservations ) throws ResourceAllocationException ;
259+ List < String > getResourceLimitStorageTagsForResourceCountOperation ( Boolean display , DiskOffering diskOffering );
258260 void checkVolumeResourceLimitForDiskOfferingChange (Account owner , Boolean display , Long currentSize , Long newSize ,
259- DiskOffering currentOffering , DiskOffering newOffering ) throws ResourceAllocationException ;
261+ DiskOffering currentOffering , DiskOffering newOffering , List < Reserver > reservations ) throws ResourceAllocationException ;
260262
261- void checkPrimaryStorageResourceLimit (Account owner , Boolean display , Long size , DiskOffering diskOffering ) throws ResourceAllocationException ;
263+ void checkPrimaryStorageResourceLimit (Account owner , Boolean display , Long size , DiskOffering diskOffering , List < Reserver > reservations ) throws ResourceAllocationException ;
262264
263265 void incrementVolumeResourceCount (long accountId , Boolean display , Long size , DiskOffering diskOffering );
264266 void decrementVolumeResourceCount (long accountId , Boolean display , Long size , DiskOffering diskOffering );
@@ -275,25 +277,23 @@ void updateVolumeResourceCountForDiskOfferingChange(long accountId, Boolean disp
275277
276278 void incrementVolumePrimaryStorageResourceCount (long accountId , Boolean display , Long size , DiskOffering diskOffering );
277279 void decrementVolumePrimaryStorageResourceCount (long accountId , Boolean display , Long size , DiskOffering diskOffering );
278- void checkVmResourceLimit (Account owner , Boolean display , ServiceOffering serviceOffering , VirtualMachineTemplate template ) throws ResourceAllocationException ;
280+ void checkVmResourceLimit (Account owner , Boolean display , ServiceOffering serviceOffering , VirtualMachineTemplate template , List < Reserver > reservations ) throws ResourceAllocationException ;
279281 void incrementVmResourceCount (long accountId , Boolean display , ServiceOffering serviceOffering , VirtualMachineTemplate template );
280282 void decrementVmResourceCount (long accountId , Boolean display , ServiceOffering serviceOffering , VirtualMachineTemplate template );
281283
282284 void checkVmResourceLimitsForServiceOfferingChange (Account owner , Boolean display , Long currentCpu , Long newCpu ,
283- Long currentMemory , Long newMemory , ServiceOffering currentOffering , ServiceOffering newOffering , VirtualMachineTemplate template ) throws ResourceAllocationException ;
285+ Long currentMemory , Long newMemory , ServiceOffering currentOffering , ServiceOffering newOffering , VirtualMachineTemplate template , List < Reserver > reservations ) throws ResourceAllocationException ;
284286
285287 void checkVmResourceLimitsForTemplateChange (Account owner , Boolean display , ServiceOffering offering ,
286- VirtualMachineTemplate currentTemplate , VirtualMachineTemplate newTemplate ) throws ResourceAllocationException ;
288+ VirtualMachineTemplate currentTemplate , VirtualMachineTemplate newTemplate , List < Reserver > reservations ) throws ResourceAllocationException ;
287289
288- void checkVmCpuResourceLimit (Account owner , Boolean display , ServiceOffering serviceOffering , VirtualMachineTemplate template , Long cpu ) throws ResourceAllocationException ;
289290 void incrementVmCpuResourceCount (long accountId , Boolean display , ServiceOffering serviceOffering , VirtualMachineTemplate template , Long cpu );
290291 void decrementVmCpuResourceCount (long accountId , Boolean display , ServiceOffering serviceOffering , VirtualMachineTemplate template , Long cpu );
291- void checkVmMemoryResourceLimit (Account owner , Boolean display , ServiceOffering serviceOffering , VirtualMachineTemplate template , Long memory ) throws ResourceAllocationException ;
292292 void incrementVmMemoryResourceCount (long accountId , Boolean display , ServiceOffering serviceOffering , VirtualMachineTemplate template , Long memory );
293293 void decrementVmMemoryResourceCount (long accountId , Boolean display , ServiceOffering serviceOffering , VirtualMachineTemplate template , Long memory );
294294
295- void checkVmGpuResourceLimit (Account owner , Boolean display , ServiceOffering serviceOffering , VirtualMachineTemplate template , Long gpu ) throws ResourceAllocationException ;
296295 void incrementVmGpuResourceCount (long accountId , Boolean display , ServiceOffering serviceOffering , VirtualMachineTemplate template , Long gpu );
297296 void decrementVmGpuResourceCount (long accountId , Boolean display , ServiceOffering serviceOffering , VirtualMachineTemplate template , Long gpu );
298297
298+ long recalculateDomainResourceCount (final long domainId , final ResourceType type , String tag );
299299}
0 commit comments