Can you query for all servers which are part of a Role for the environment being deployed to?

So just as the title, be able to query for all servers which are in a certain Role for the environment being deployed to.

for example I’d want a list of current load balancers which could be set up as part of the environment, ps scripts could then use this to know which servers to call for dropping and adding load.

Hi Daniel,

Thanks for getting in touch. There’s no way to do this via the UI, but you can do it using the Octopus REST API. You can make a GET request to /api/machines/all, and then filter the machines by role and/or by environment. Alternatively you can use /api/environments/{id}/machines.

Here’s some information about using the REST API:

Hope that helps!

Paul