From 59d052193dde3307325eb695a0d928bfcc0b723c Mon Sep 17 00:00:00 2001 From: John Bowdre <61015723+jbowdre@users.noreply.github.com> Date: Tue, 14 Jun 2022 14:59:26 -0500 Subject: [PATCH] Delete vraGetVcenter.js --- .../vraGetVcenter.js | 20 ------------------- 1 file changed, 20 deletions(-) delete mode 100644 Orchestrator/Actions/com.virtuallypotato.inputs/vraGetVcenter.js diff --git a/Orchestrator/Actions/com.virtuallypotato.inputs/vraGetVcenter.js b/Orchestrator/Actions/com.virtuallypotato.inputs/vraGetVcenter.js deleted file mode 100644 index aeb9e68..0000000 --- a/Orchestrator/Actions/com.virtuallypotato.inputs/vraGetVcenter.js +++ /dev/null @@ -1,20 +0,0 @@ -/* JavaScript: vraGetVcenter action - Returns the vCenter hostname associated with a given site. - Inputs: zoneName (string) - Return type: string -*/ -var cloudAccountId = null; -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; -System.debug("Zones: " + JSON.stringify(zones)); -for each (zone in zones) { - if (zone.name === zoneName) { - cloudAccountId = (zone._links["cloud-account"].href).split('/').pop(); - } - if (cloudAccountId != null) { break; }; -} -System.debug("Cloud Account ID: " + cloudAccountId); -var vCenterName = JSON.parse(System.getModule("com.virtuallypotato.utility").vraExecute(token, "GET", "/iaas/api/cloud-accounts-vsphere/" + cloudAccountId, null)).hostName.split('.')[0]; -System.getModule("com.virtuallypotato.utility").vraLogout(token); - -return vCenterName;