Skip to content

Commit 6593ed6

Browse files
tusharlimbhoretlimbhore
andauthored
Reconfigure workflow added and version changed (#51)
* Reconfigure workflow added and version changed * changes made in attach vro client workflow Co-authored-by: tlimbhore <[email protected]>
1 parent 8a2b799 commit 6593ed6

File tree

10 files changed

+9443
-8783
lines changed

10 files changed

+9443
-8783
lines changed

o11nplugin-vro-core/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<parent>
1111
<artifactId>vro</artifactId>
1212
<groupId>com.vmware.avi</groupId>
13-
<version>20.1.1</version>
13+
<version>20.1.1.RELEASE</version>
1414
</parent>
1515

1616
<dependencies>
@@ -19,7 +19,7 @@
1919
<dependency>
2020
<groupId>com.vmware.avi.sdk</groupId>
2121
<artifactId>avisdk</artifactId>
22-
<version>20.1.1-beta-3</version>
22+
<version>20.1.1.RELEASE</version>
2323
</dependency>
2424

2525
<dependency>

o11nplugin-vro-package/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<parent>
1010
<artifactId>vro</artifactId>
1111
<groupId>com.vmware.avi</groupId>
12-
<version>20.1.1</version>
12+
<version>20.1.1.RELEASE</version>
1313
</parent>
1414

1515
<properties>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
3+
<properties>
4+
<comment>Exported from [server]</comment>
5+
<entry key="categoryPath">com.vmware.avi</entry>
6+
<entry key="name">getVirtualServiceDetails</entry>
7+
<entry key="type">ScriptModule</entry>
8+
<entry key="id">e3ca802a-b1d0-413b-9e0e-8a6ef7e98571</entry>
9+
</properties>
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<dunes-script-module name="getVirtualServiceDetails"
3+
result-type="Avi:AviVroClient" api-version="6.0.0"
4+
id="e3ca802a-b1d0-413b-9e0e-8a6ef7e98571" version="0.0.0"
5+
allowed-operations="vfe">
6+
<param n="vsObject" t="Avi:VirtualService"><![CDATA[]]>
7+
</param>
8+
<param n="object" t="string"><![CDATA[]]>
9+
</param>
10+
<param n="field" t="string"><![CDATA[]]>
11+
</param>
12+
<script encoded="false"><![CDATA[var url=vsObject.getUrl();
13+
var controller=url.substring(url.indexOf("//")+2, url.indexOf("/api"));
14+
var aviVroClient=null;
15+
vroClientArray=Server.findAllForType('Avi:AviVroClient','');
16+
for each(vroClient in vroClientArray){
17+
if(vroClient !=null){
18+
vroController=vroClient.cred.controller;
19+
if(vroController==controller){
20+
aviVroClient=vroClient;
21+
}
22+
}
23+
}
24+
try{
25+
if(aviVroClient!=null)
26+
{
27+
if(object=="virtualservice"){
28+
if(field == "name"){
29+
return vsObject.getName();
30+
}else if(field == "application_profile"){
31+
var myAviService = new AviService() ;
32+
myAviService=vsObject.getServices()[0];
33+
var servicePort=myAviService.getPort();
34+
var apptype="HTTP";
35+
if(servicePort==443){
36+
apptype="HTTPS";
37+
}
38+
return apptype;
39+
}else if(field == "service_port"){
40+
var myAviService = new AviService() ;
41+
myAviService=vsObject.getServices()[0];
42+
return myAviService.getPort();
43+
}else if(field == "controller"){
44+
return (url.substring(url.indexOf("//")+2, url.indexOf("/api")));
45+
}else{
46+
47+
}
48+
}else if(object=="vsvip"){
49+
var vsVipref=vsObject.getVsvipRef();
50+
if(vsVipref!=null){
51+
var vsVipUUID = vsVipref.substring(vsVipref.indexOf('vsvip-'),vsVipref.indexOf('#'));
52+
var myAviVsVip = new AviVsVip() ;
53+
myAviVsVip=aviVroClient.getObjectByUUID('vsvip',vsVipUUID);
54+
var vipList=myAviVsVip.getVip();
55+
var iPaddressObject =vipList[0].getIpAddress();
56+
var ipAddress=iPaddressObject.getAddr();
57+
return ipAddress;
58+
}
59+
}else if(object=="pool"){
60+
var poolref=vsObject.getPoolRef();
61+
if(poolref!=null){
62+
var poolUUID = poolref.substring(poolref.indexOf('pool-'),poolref.indexOf('#'));
63+
var poolObject = new AviPool() ;
64+
poolObject =aviVroClient.getObjectByUUID('pool',poolUUID);
65+
if(field == "pool_servers"){
66+
var servers = poolObject.servers;
67+
var ServerList= new Array();
68+
for each(index in servers){
69+
ServerList.push(index.ip.addr)
70+
}
71+
return ServerList;
72+
}else{
73+
var servers = poolObject.servers;
74+
var port;
75+
for each(index in servers){
76+
port = index.port;
77+
}
78+
return port
79+
}
80+
}
81+
}else{
82+
var poolref=vsObject.getPoolRef();
83+
if(poolref!=null){
84+
var poolUUID = poolref.substring(poolref.indexOf('pool-'),poolref.indexOf('#'));
85+
var poolObject = new AviPool() ;
86+
poolObject =aviVroClient.getObjectByUUID('pool',poolUUID);
87+
var hmArray=poolObject.getHealthMonitorRefs();
88+
var HealthMonitor_ref=hmArray[0];
89+
var hmUuid =HealthMonitor_ref.substring(HealthMonitor_ref.indexOf("/healthmonitor-")+1, HealthMonitor_ref.indexOf("#"));
90+
var hmObject = new AviHealthMonitor();
91+
hmObject=aviVroClient.getObjectByUUID('healthmonitor',hmUuid);
92+
if(field=="health_monitor_type"){
93+
var healthMonitorType=hmObject.getType();
94+
if(healthMonitorType=="HEALTH_MONITOR_PING"){
95+
healthMonitorType="ping";
96+
}else{
97+
healthMonitorType="TCP";
98+
}
99+
return healthMonitorType;
100+
}else if(field=="monitor_port"){
101+
return monitor_port=hmObject.getMonitorPort();
102+
}else if(field=="time_out"){
103+
return hmObject.getReceiveTimeout();
104+
}else if(field=="send_interval"){
105+
return hmObject.getSendInterval();
106+
}else if(field=="successful_check"){
107+
return hmObject.getSuccessfulChecks();
108+
}else{
109+
return hmObject.getFailedChecks();
110+
}
111+
112+
}
113+
114+
}
115+
}
116+
}catch(e){
117+
System.log("Error occured while getting object detail: "+e)
118+
}
119+
120+
121+
122+
123+
]]></script>
124+
</dunes-script-module>

o11nplugin-vro-package/src/main/resources/Workflow/Library/vro/Attach Avi Controller.xml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44
xsi:schemaLocation="http://vmware.com/vco/workflow http://vmware.com/vco/workflow/Workflow-v4.xsd"
55
root-name="item2" object-name="workflow:name=generic"
6-
id="d541c0da-5105-4c9b-b73b-bae90340e31f" version="0.0.6"
6+
id="d541c0da-5105-4c9b-b73b-bae90340e31f" version="0.0.7"
77
api-version="6.0.0" allowed-operations="vef" restartMode="1"
88
resumeFromFailedMode="0">
99
<display-name><![CDATA[Attach Avi Controller]]></display-name>
@@ -72,10 +72,15 @@ System.getModule("com.vmware.avi").attachVroClient(controller,username,password,
7272
</workflow-item>
7373
<workflow-item name="item4" out-name="item1" type="task">
7474
<display-name><![CDATA[Get host from base url]]></display-name>
75-
<script encoded="false"><![CDATA[host = controller.substring(8, controller.length);
76-
var end = host.indexOf("/");
77-
if (end != -1) {
75+
<script encoded="false"><![CDATA[var flag=(controller.indexOf('https') == 0);
76+
if(flag){
77+
host = controller.substring(8, controller.length);
78+
var end = host.indexOf("/");
79+
if (end != -1) {
7880
host = host.substring(0, end);
81+
}
82+
}else{
83+
host=controller;
7984
}]]></script>
8085
<in-binding>
8186
<bind name="controller" type="string" export-name="controller"></bind>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
3+
<properties>
4+
<comment>Exported from [server]</comment>
5+
<entry key="categoryPath">Library.Avi.VRA</entry>
6+
<entry key="name">Reconfigure Virtual service</entry>
7+
<entry key="type">Workflow</entry>
8+
<entry key="id">21277c02-55ba-42f0-b2ba-d576141dc645</entry>
9+
</properties>

0 commit comments

Comments
 (0)