List all agents within an application environment

244 Views Asked by At

How do I list all the agents which are used in a specific environment of a Udeploy application?

The resources within the application environment may have hierarchical relationship with an agent at the leaf level of the resource structure.

I need to list the agents only.

Please note that the getEnvironmentBaseResource gives me only the name of the top most resource layer, but it does not list the entire resource hierarchy till the agents.

1

There are 1 best solutions below

0
rodridevops On BEST ANSWER

You should make a nested call.

First get all environments within the application, with:

getEnvironmentsInApplication

And then, get all base resources for an environment with getEnvironmentBaseResources

After that you may parse the response with groovy to get and manipulate the json