vrealize/Orchestrator/Actions/com.virtuallypotato.inputs/vraGetZones.js

18 lines
549 B
JavaScript
Raw Normal View History

2022-06-14 13:53:03 +00:00
/* JavaScript: vraGetZones action
Returns the names of available Cloud Zones.
Inputs: none
Return type: Array/string
*/
var zoneNames = new Array();
var token = System.getModule("com.virtuallypotato.utility").vraLogin();
var zones = JSON.parse(System.getModule("com.virtuallypotato.utility").vraExecute(token, "GET", "/iaas/api/zones", null)).content;
zones.forEach(
function (zone) {
zoneNames.push(zone.name);
}
);
zoneNames.sort();
System.getModule("com.virtuallypotato.utility").vraLogout(token);
return zoneNames;