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
@@ -191,6 +192,7 @@ public interface ResourceLimitService {
191192 */
192193 public void checkResourceLimit (Account account , ResourceCount .ResourceType type , long ... count ) throws ResourceAllocationException ;
193194 public void checkResourceLimitWithTag (Account account , ResourceCount .ResourceType type , String tag , long ... count ) throws ResourceAllocationException ;
195+ public void checkResourceLimitWithTag (Account account , Long domainId , boolean considerSystemAccount , ResourceCount .ResourceType type , String tag , long ... count ) throws ResourceAllocationException ;
194196
195197 /**
196198 * Gets the count of resources for a resource type and account
@@ -251,12 +253,12 @@ public interface ResourceLimitService {
251253 List <String > getResourceLimitStorageTags (DiskOffering diskOffering );
252254 void updateTaggedResourceLimitsAndCountsForAccounts (List <AccountResponse > responses , String tag );
253255 void updateTaggedResourceLimitsAndCountsForDomains (List <DomainResponse > responses , String tag );
254- void checkVolumeResourceLimit (Account owner , Boolean display , Long size , DiskOffering diskOffering ) throws ResourceAllocationException ;
255-
256+ void checkVolumeResourceLimit (Account owner , Boolean display , Long size , DiskOffering diskOffering , List < Reserver > reservations ) throws ResourceAllocationException ;
257+ List < String > getResourceLimitStorageTagsForResourceCountOperation ( Boolean display , DiskOffering diskOffering );
256258 void checkVolumeResourceLimitForDiskOfferingChange (Account owner , Boolean display , Long currentSize , Long newSize ,
257- DiskOffering currentOffering , DiskOffering newOffering ) throws ResourceAllocationException ;
259+ DiskOffering currentOffering , DiskOffering newOffering , List < Reserver > reservations ) throws ResourceAllocationException ;
258260
259- void checkPrimaryStorageResourceLimit (Account owner , Boolean display , Long size , DiskOffering diskOffering ) throws ResourceAllocationException ;
261+ void checkPrimaryStorageResourceLimit (Account owner , Boolean display , Long size , DiskOffering diskOffering , List < Reserver > reservations ) throws ResourceAllocationException ;
260262
261263 void incrementVolumeResourceCount (long accountId , Boolean display , Long size , DiskOffering diskOffering );
262264 void decrementVolumeResourceCount (long accountId , Boolean display , Long size , DiskOffering diskOffering );
@@ -273,25 +275,23 @@ void updateVolumeResourceCountForDiskOfferingChange(long accountId, Boolean disp
273275
274276 void incrementVolumePrimaryStorageResourceCount (long accountId , Boolean display , Long size , DiskOffering diskOffering );
275277 void decrementVolumePrimaryStorageResourceCount (long accountId , Boolean display , Long size , DiskOffering diskOffering );
276- void checkVmResourceLimit (Account owner , Boolean display , ServiceOffering serviceOffering , VirtualMachineTemplate template ) throws ResourceAllocationException ;
278+ void checkVmResourceLimit (Account owner , Boolean display , ServiceOffering serviceOffering , VirtualMachineTemplate template , List < Reserver > reservations ) throws ResourceAllocationException ;
277279 void incrementVmResourceCount (long accountId , Boolean display , ServiceOffering serviceOffering , VirtualMachineTemplate template );
278280 void decrementVmResourceCount (long accountId , Boolean display , ServiceOffering serviceOffering , VirtualMachineTemplate template );
279281
280282 void checkVmResourceLimitsForServiceOfferingChange (Account owner , Boolean display , Long currentCpu , Long newCpu ,
281- Long currentMemory , Long newMemory , ServiceOffering currentOffering , ServiceOffering newOffering , VirtualMachineTemplate template ) throws ResourceAllocationException ;
283+ Long currentMemory , Long newMemory , ServiceOffering currentOffering , ServiceOffering newOffering , VirtualMachineTemplate template , List < Reserver > reservations ) throws ResourceAllocationException ;
282284
283285 void checkVmResourceLimitsForTemplateChange (Account owner , Boolean display , ServiceOffering offering ,
284- VirtualMachineTemplate currentTemplate , VirtualMachineTemplate newTemplate ) throws ResourceAllocationException ;
286+ VirtualMachineTemplate currentTemplate , VirtualMachineTemplate newTemplate , List < Reserver > reservations ) throws ResourceAllocationException ;
285287
286- void checkVmCpuResourceLimit (Account owner , Boolean display , ServiceOffering serviceOffering , VirtualMachineTemplate template , Long cpu ) throws ResourceAllocationException ;
287288 void incrementVmCpuResourceCount (long accountId , Boolean display , ServiceOffering serviceOffering , VirtualMachineTemplate template , Long cpu );
288289 void decrementVmCpuResourceCount (long accountId , Boolean display , ServiceOffering serviceOffering , VirtualMachineTemplate template , Long cpu );
289- void checkVmMemoryResourceLimit (Account owner , Boolean display , ServiceOffering serviceOffering , VirtualMachineTemplate template , Long memory ) throws ResourceAllocationException ;
290290 void incrementVmMemoryResourceCount (long accountId , Boolean display , ServiceOffering serviceOffering , VirtualMachineTemplate template , Long memory );
291291 void decrementVmMemoryResourceCount (long accountId , Boolean display , ServiceOffering serviceOffering , VirtualMachineTemplate template , Long memory );
292292
293- void checkVmGpuResourceLimit (Account owner , Boolean display , ServiceOffering serviceOffering , VirtualMachineTemplate template , Long gpu ) throws ResourceAllocationException ;
294293 void incrementVmGpuResourceCount (long accountId , Boolean display , ServiceOffering serviceOffering , VirtualMachineTemplate template , Long gpu );
295294 void decrementVmGpuResourceCount (long accountId , Boolean display , ServiceOffering serviceOffering , VirtualMachineTemplate template , Long gpu );
296295
296+ long recalculateDomainResourceCount (final long domainId , final ResourceType type , String tag );
297297}
0 commit comments