From c071bd5ccefc93b6501003436ff1ce808f0b9a07 Mon Sep 17 00:00:00 2001 From: John Bowdre <61015723+jbowdre@users.noreply.github.com> Date: Wed, 15 Jun 2022 10:32:41 -0500 Subject: [PATCH] Create getSdkConnectionForVC.js --- .../getSdkConnectionForVC.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Orchestrator/Actions/com.virtuallypotato.utility/getSdkConnectionForVC.js diff --git a/Orchestrator/Actions/com.virtuallypotato.utility/getSdkConnectionForVC.js b/Orchestrator/Actions/com.virtuallypotato.utility/getSdkConnectionForVC.js new file mode 100644 index 0000000..d3e5a67 --- /dev/null +++ b/Orchestrator/Actions/com.virtuallypotato.utility/getSdkConnectionForVC.js @@ -0,0 +1,15 @@ +/* JavaScript: getSdkConnectionForVC + Returns the VC:sdkConnection object for a given vCenter name (FQDN) + Inputs: vCenterName (string) + Return Type: VC:SdkConnection +*/ +var vcSdkConnection = null; +var sdkConnections = VcPlugin.allSdkConnections; +for each (sdkConnection in sdkConnections) { + if (sdkConnection.sdkId === vCenterName) { + System.debug("Found matching vCenter SDK endpoint: " + sdkConnection.name); + vcSdkConnection = sdkConnection; + } + if (vcSdkConnection != null) { break; }; +} +return vcSdkConnection;