How to: Get a list of all environments for a specific application in Release

Question

How can we get the list of all environments for a specific application in a release?

Answer

You can use the Jython API or the REST API to obtain this information. 

Steps to Follow

Jython API

If you want to use the Jython API, create a Jython script task and try to use the following lines:

application=applicationApi.getById('Application2834ffd6016a4affb226fbb175b2474a')
print application.environments

This will give you the list of Environments ID's for a specific application.

Rest API

If you want to use REST API, you can use the command as follows which returns all the Environments that belong to an Application:

curl -u xxxx:xxxx 'http://localhost:5516/api/v1/applications/Configuration/environmentManagement/Application17a9158823e44ee8a009ad68e28d6232' -i -X GET \
-H 'Accept: application/json'

 

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.