mirror of
https://github.com/jbowdre/vRealize.git
synced 2024-12-22 04:52:18 +00:00
Create vraGetZones.js
This commit is contained in:
parent
84924248fb
commit
db9c410571
1 changed files with 17 additions and 0 deletions
|
@ -0,0 +1,17 @@
|
|||
/* 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;
|
Loading…
Reference in a new issue