Hello everyone,
Lately I'm working a lot with resources so I have another resource related question.
In my current scenario I want to get the available resource count to perform some actions.
I have figure out a way to do so with the following code:
1. import com.pmease.quickbuild.entitymanager.ResourceManager;
2. import com.pmease.quickbuild.rest.resources.ResourceResource;
3.
4. def resource = ResourceManager.instance.get( "ResourceName");
5. def resource_id = resource.getId();
6. // null checks
7.
8. ResourceResource r_resource = new ResourceResource();
9. def available_resource_obj = r_resource.getAvailable( resource_id );
So I'm utilizing the ResourceResource class to get the available resources count and it works if I start a build. The problem arises when the scheduler starts the build. On which case I get this error message:
ERROR - Step 'master>Test_Get_Available_Resource' is failed: null
So I have the following questsions;
a. Is this caused because I'm using the rest classes? If yes, is something wrong with related to QB's config?
b. Could I get the available resources with some other way that's not too complicated ?
- solved #2
- replies 2
- views 309
- stars 0