Automic Workload Automation

 View Only
  • 1.  Programmatically change the order of an Agent Group

    Posted Apr 18, 2018 10:32 AM

    Is it possible to programmatically change the order of Agents in a HOSTG?

    I have a HOSTG that has two Agents in it and it is set to use the first. I want to be able to change what Agent is listed first via a SCRI.



  • 2.  Re: Programmatically change the order of an Agent Group

    Posted Aug 29, 2018 11:02 AM

    I know of no way to alter agent groups via AE scripting. You can however do this via the HostGroup Java API class. I don’t know if it’s possible to remove a single agent, but you can do something like this:

    1. Get the list of agents using the hosts() method;
    2. Remove all agents using the clear() method;
    3. Add the hosts back in the desired order using the addHost() method.

     

    #aejavaapis #agentgroup



  • 3.  Re: Programmatically change the order of an Agent Group

    Posted Aug 29, 2018 11:41 AM

    Thank you, this is what i was afraid of.

    But on a positive note it looks like the RESTful API in 12.1 will allow me to do this.



  • 4.  Re: Programmatically change the order of an Agent Group

    Posted Aug 29, 2018 11:44 AM

    You could also determine the agent to use programmatically, and set it using :PUT_ATT.

     

    See this discussion for an example:

    Set agent group of a job programmatically