How to get the associated environment within the list of applications using a database sql query of a API call ?
Release Automation - All versions.
Here are some SQL Queries to get the information directly in the database :
SELECT a.APP_NAME 'Application Name', e.name 'Environment'
FROM applications a
INNER JOIN environments e ON a.ID=e.applicationId
WHERE A.APP_NAME <>'____Default Application'
ORDER BY 1,2
SELECT a.APP_NAME 'Application Name', e.name 'Environment'
FROM applications a
INNER JOIN environments e ON a.ID=e.applicationId
WHERE A.APP_NAME ='TEST_APP2'
ORDER BY 1,2
Example :
Then execute this to find all environments associated to TEST_APP2 application :
curl "http://nac_name:8080/datamanagement/a/api/v6/applications/4/environments?only_active=true" -u superuser:suser
Result is :
[{"applicationName":"TEST_APP2","applicationId":"4","description":"Environment for Default Architecture","name":"Environment for Default Architecture","id":"3"},{"applicationName":"TEST_APP2","applicationId":"4","name":"Env_App2","id":"5"}]