Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Is it possible to reset a server job count using the api?

We have servers with MaxJobCount =1;  Often, the job count will be set to "1" even when no job step is running on that server object.  I am able to query all active jobs and determine that no active job step is using that server.  I can use the api to query the job count, but I do not see a function to set or reset the job count.

perl or java would be ok, but I would prefer perl.

my $running = BuildForge::Services::DBO::Build->findRunning($connection);  # all active jobs
foreach my $build (@$running)  {   # examine each job
   my $rslts = $build->getResults();  # get all steps
      foreach my $rslt (@$rslts) { # examine each step
         my $result = $rslt->getResult();  # if "RUNNING" this step is active
         my $server_uuid = $rslt->getServerUuid(); # determine what server it is running on
         .....

my $servers = BuildForge::Services::DBO::Server->findAll($connection);  # get all servers
    foreach my $server (@$servers) {
        my $jobs = $server->getCurrentJobs();  # get the job count
        if ($jobs>0) {
            # server thinks it has an active job   
        }
      
If the server job count is > 0 and no active job/step is using it I need something like:

   $server->setCurrentJobs(0);  or $server->resetCurrentJobs();  or equivalent.


0 votes


Be the first one to answer this question!

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 12,023

Question asked: Jun 29 '15, 5:17 p.m.

Question was seen: 2,374 times

Last updated: Jun 29 '15, 10:33 p.m.

Confirmation Cancel Confirm