vCO Workflow Script to Check vShield Load Balancer Configuration

The following script checks the vShield Load Balancer Configuration

 

System.log("============================================================");
System.log("===== Edge Gateway Name: " + objOrgVdcGateway.name);
System.log("============================================================");

var objVclGatewayConfiguration;
	objVclGatewayConfiguration = objVclGateway.configuration;

var objVclGatewayInterfaces;
	objVclGatewayInterfaces = objVclGatewayConfiguration.gatewayInterfaces;

var objVclObjectListInterface;
	objVclObjectListInterface = objVclGatewayInterfaces.gatewayInterface;

var arrVclGatewayInterface;
	arrVclGatewayInterface = objVclObjectListInterface.enumerate();

var objVclGatewayFeatures;
	objVclGatewayFeatures = objVclGatewayConfiguration.edgeGatewayServiceConfiguration;

var objVclAbstractObjectSet;
	objVclAbstractObjectSet = objVclGatewayFeatures.networkService;

System.log("===== Number of Network Services: " + objVclAbstractObjectSet.size());

var arrVclLoadBalancerService;
	arrVclLoadBalancerService = objVclAbstractObjectSet.find(new VclLoadBalancerService());

System.log("===== Number of Load Balancer Services: " + arrVclLoadBalancerService.length);

var objVclLoadBalancerService;
	objVclLoadBalancerService = arrVclLoadBalancerService[0];

System.log("===== Load Balancer Service Found, Enabled?: " + objVclLoadBalancerService.isEnabled);

var objVclObjectListPool;
	objVclObjectListPool = objVclLoadBalancerService.pool;

System.log("===== Number of Load Balancer Pools: " + objVclObjectListPool.size());

var arrVclLoadBalancerPool;
	arrVclLoadBalancerPool = objVclObjectListPool.enumerate();

var objVclObjectListVirtualServer;
	objVclObjectListVirtualServer = objVclLoadBalancerService.virtualServer;

System.log("===== Number of Load Balancer Virtual Servers: " + objVclObjectListVirtualServer.size());

var arrVclLoadBalancerVirtualServer;
	arrVclLoadBalancerVirtualServer = objVclObjectListVirtualServer.enumerate();

for each (var i = 0; i < arrVclGatewayInterface.length; i++)
{
	var objVclGatewayInterface;
		objVclGatewayInterface = arrVclGatewayInterface[i];

	System.log("============================================================");
	System.log("===== Interface [" + i + "] ===== Name: " + objVclGatewayInterface.name);
	System.log("===== Interface [" + i + "] ===== Display Name: " + objVclGatewayInterface.displayName);
	System.log("===== Interface [" + i + "] ===== Interface Type: " + objVclGatewayInterface.interfaceType);
	System.log("===== Interface [" + i + "] ===== In Rate Limit: " + objVclGatewayInterface.inRateLimit);
	System.log("===== Interface [" + i + "] ===== Out Rate Limit: " + objVclGatewayInterface.outRateLimit);
	System.log("============================================================");
}

for each (var i = 0; i < arrVclLoadBalancerPool.length; i++)
{
	var objVclLoadBalancerPool;
		objVclLoadBalancerPool = arrVclLoadBalancerPool[i];

	System.log("============================================================");
	System.log("===== Pool [" + i + "] ===== ID: " + objVclLoadBalancerPool.id);
	System.log("===== Pool [" + i + "] ===== Name: " + objVclLoadBalancerPool.name);
	System.log("===== Pool [" + i + "] ===== Description: " + objVclLoadBalancerPool.description);
	System.log("===== Pool [" + i + "] ===== Error Details: " + objVclLoadBalancerPool.errorDetails);
	System.log("===== Pool [" + i + "] ===== Operational: " + objVclLoadBalancerPool.operational);
	System.log("============================================================");
}

for each (var i = 0; i < arrVclLoadBalancerVirtualServer.length; i++)
{
	var objVclLoadBalancerVirtualServer;
		objVclLoadBalancerVirtualServer = arrVclLoadBalancerVirtualServer[i];

	System.log("============================================================");
	System.log("===== Virtual Server [" + i + "] ===== Name: " + objVclLoadBalancerVirtualServer.name);
	System.log("===== Virtual Server [" + i + "] ===== Description: " + objVclLoadBalancerVirtualServer.description);
	System.log("===== Virtual Server [" + i + "] ===== IP: " + objVclLoadBalancerVirtualServer.ipAddress);
	System.log("===== Virtual Server [" + i + "] ===== Pool: " + objVclLoadBalancerVirtualServer.pool);
	System.log("===== Virtual Server [" + i + "] ===== Enabled: " + objVclLoadBalancerVirtualServer.isEnabled);
	System.log("===== Virtual Server [" + i + "] ===== Logging: " + objVclLoadBalancerVirtualServer.logging);
	System.log("============================================================");
}

Leave a Reply