Automic Workload Automation

Expand all | Collapse all

Is there any Java API to get all agent names in a agent group? And if I know an agent name, Is there any API call to get its agent group?

  • 1.  Is there any Java API to get all agent names in a agent group? And if I know an agent name, Is there any API call to get its agent group?

    Posted Sep 21, 2018 02:51 AM

    If my AgentGroupListItem is "ABC.XYZ" (Agent group name), I want to get names and hosts of all the agents in this group and vice versa. 



  • 2.  Re: Is there any Java API to get all agent names in a agent group? And if I know an agent name, Is there any API call to get its agent group?

    Posted Sep 21, 2018 08:46 AM

    Hi,

     

    here's how I get the hosts of an agent group in powershell. Should be easy to adopt for Java. I always wondered why I had to open an object to read it's properties, but never figured out if it's realy necessary. Maybe someone else knows a better way.

     

    $openReq   = New-Object com.uc4.communication.requests.OpenObject -ArgumentList 'ABC.XYZ', $true, $true;
    $conn.sendRequestAndWait($openReq);   
    $obj = $openReq.getUC4Object();
    $hosts = $obj.hosts();   

    while($hosts.hasNext()){
            $hosts.next().getName();   
    }

     

    I think the best way to do the other way round is to use SQL. But don't pin me down to that.

     

    Matthias