-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AV-175720: Update all vRO workflows and actions to add UUID of the ob…
…ject.
- Loading branch information
Showing
17 changed files
with
484 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
...ckage/src/main/resources/ScriptModule/com/vmware/actions/fetchUuidbyName.element_info.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> | ||
<properties> | ||
<comment>Exported from [server]</comment> | ||
<entry key="categoryPath">com.vmware.avi</entry> | ||
<entry key="name">fetchUuidbyName</entry> | ||
<entry key="type">ScriptModule</entry> | ||
<entry key="id">aab1273f-30f0-4cef-ad2b-da6832d71040</entry> | ||
</properties> |
61 changes: 61 additions & 0 deletions
61
...plugin-vro-package/src/main/resources/ScriptModule/com/vmware/actions/fetchUuidbyName.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<dunes-script-module name="fetchUuidbyName" | ||
result-type="string" api-version="6.0.0" | ||
id="aab1273f-30f0-4cef-ad2b-da6832d71040" version="1.0.1" | ||
allowed-operations="vfe"> | ||
<param n="controller" t="string"><![CDATA[IP of the controller]]></param> | ||
<param n="objectType" t="string"><![CDATA[Add object type ]]></param> | ||
<param n="objectName" t="string"><![CDATA[Add object type ]]></param> | ||
<script encoded="false"><![CDATA[/************************************************************ | ||
* This action fetch AVI object UUID by Name * | ||
* and return object name. * | ||
*************************************************************/ | ||
try{ | ||
if(controller == null){ | ||
return null; | ||
} | ||
var vroClientArray = Server.findAllForType('Avi:AviVroClient',''); | ||
var aviPlugin = null; | ||
var controllerIp = controller.substring(0, controller.lastIndexOf("-")); | ||
var clientTenant = controller.substring(controller.lastIndexOf("-") + 1).toLowerCase(); | ||
for each(aviVroClient in vroClientArray){ | ||
if(aviVroClient != null){ | ||
vroController = aviVroClient.cred.controller; | ||
controllerTenant = aviVroClient.cred.tenant; | ||
if((vroController == controllerIp)&&(controllerTenant == clientTenant)){ | ||
System.log("Found client with the given IP"); | ||
aviPlugin = aviVroClient; | ||
} | ||
} | ||
} | ||
if (aviPlugin != null){ | ||
if(objectType=="healthmonitor" && (objectName != "" || objectName != null)){ | ||
var healthMonitorObj = AviHealthMonitor(); | ||
healthMonitorObj = aviPlugin.getObjectByName('healthmonitor', objectName, clientTenant); | ||
return healthMonitorObj.getUuid(); | ||
}else if(objectType=="pool" && (objectName != "" || objectName != null)){ | ||
var poolObj = AviPool(); | ||
poolObj = aviPlugin.getObjectByName('pool', objectName, clientTenant); | ||
return poolObj.getUuid(); | ||
}else if(objectType=="poolgroup" && (objectName != "" || objectName != null)){ | ||
var poolGroupObj = AviPoolGroup(); | ||
poolGroupObj = aviPlugin.getObjectByName('poolgroup', objectName, clientTenant); | ||
return poolGroupObj.getUuid(); | ||
}else if(objectType=="vsvip" && (objectName != "" || objectName != null)){ | ||
var vsvipObj = AviVsVip(); | ||
vsvipObj = aviPlugin.getObjectByName('vsvip', objectName, clientTenant); | ||
return vsvipObj.getUuid(); | ||
}else if(objectType=="virtualservice" && (objectName != "" || objectName != null)){ | ||
var virtualserviceObj = AviVirtualService(); | ||
virtualserviceObj = aviPlugin.getObjectByName('virtualservice', objectName, clientTenant); | ||
return virtualserviceObj.getUuid(); | ||
}else { | ||
} | ||
} | ||
}catch(e){ | ||
System.log("Object name is not found."); | ||
return null; | ||
} | ||
]]></script> | ||
</dunes-script-module> |
Oops, something went wrong.