<< Back to previous view

[QB-1290] API method to see if resource is available.
Created: 13/Jun/12  Updated: 27/Dec/12

Status: Resolved
Project: QuickBuild
Component/s: None
Affects Version/s: 4.0.20
Fix Version/s: None

Type: Improvement Priority: Minor
Reporter: Maitland Lederer Assigned To: Robin Shen
Resolution: Fixed Votes: 0
Remaining Estimate: Unknown Time Spent: Unknown
Original Estimate: Unknown


 Description   
It would be nice to have script access to the count of a resource that is available, without altering the resource count (aka grabbing the resource).

 Comments   
Comment by Robin Shen [ 27/Dec/12 12:45 PM ]
This can be done with below script in QB5
groovy:
import com.pmease.quickbuild.*
import com.pmease.quickbuild.entitymanager.*

def resource = ResourceManager.instance.get("name of the resource")
def requests = BuildEngine.instance.getBuildRequests(null)

logger.info("Available resource count: " + (resource.getCount() - resource.getUsedCount(requests))
Generated at Thu May 16 21:10:40 UTC 2024 using JIRA 189.