Function: Check Load Balancer Configuration

by Simon Sparks · 5 September 2025

To use this function add it to the class library file named vCloudService.ts

GitHub Repository: https://github.com/SimonSparksUK/Orchestrator

Filename: vCloudService.ts

Description: Orchestrator Function to Check the Load Balancer Configuration

Function VclGatewayCheckVclLoadBalancer

public VclGatewayCheckVclLoadBalancer(objVclGateway: VclGateway): void {
    this.objLogger.info("============================================================");
    this.objLogger.info("===== Edge Gateway Name: " + objVclGateway.name);
    this.objLogger.info("============================================================");

    let objVclGatewayConfiguration: VclGatewayConfiguration = objVclGateway.configuration;

    let objVclGatewayInterfaces: VclGatewayInterfaces = objVclGatewayConfiguration.gatewayInterfaces;

    let objVclObjectListInterface: VclObjectList = objVclGatewayInterfaces.gatewayInterface;

    let arrVclGatewayInterface: VclGatewayInterface[] = objVclObjectListInterface.enumerate();

    let objVclGatewayFeatures: VclGatewayFeatures = objVclGatewayConfiguration.edgeGatewayServiceConfiguration;

    let objVclAbstractObjectSet: VclAbstractObjectSet = objVclGatewayFeatures.networkService;

    this.objLogger.info("===== Number of Network Services: " + objVclAbstractObjectSet.size());

    let arrVclLoadBalancerService: VclLoadBalancerService[] = objVclAbstractObjectSet.find(new VclLoadBalancerService());

    this.objLogger.info("===== Number of Load Balancer Services: " + arrVclLoadBalancerService.length);

    let objVclLoadBalancerService: VclLoadBalancerService = arrVclLoadBalancerService[0];

    this.objLogger.info("===== Load Balancer Service Found, Enabled?: " + objVclLoadBalancerService.isEnabled);

    let objVclObjectListPool: VclObjectList = objVclLoadBalancerService.pool;

    this.objLogger.info("===== Number of Load Balancer Pools: " + objVclObjectListPool.size());

    let arrVclLoadBalancerPool: VclLoadBalancerPool[] = objVclObjectListPool.enumerate();

    let objVclObjectListVirtualServer: VclObjectList = objVclLoadBalancerService.virtualServer;

    this.objLogger.info("===== Number of Load Balancer Virtual Servers: " + objVclObjectListVirtualServer.size());

    let arrVclLoadBalancerVirtualServer: VclLoadBalancerVirtualServer[] = objVclObjectListVirtualServer.enumerate();

    arrVclGatewayInterface.forEach((objVclGatewayInterface: VclGatewayInterface): void => {

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

    arrVclLoadBalancerPool.forEach((objVclLoadBalancerPool: VclLoadBalancerPool): void => {

        this.objLogger.info("============================================================");
        this.objLogger.info("===== Pool [" + objVclLoadBalancerPool.id + "] ===== Name: " + objVclLoadBalancerPool.name);
        this.objLogger.info("===== Pool [" + objVclLoadBalancerPool.id + "] ===== Description: " + objVclLoadBalancerPool.description);
        this.objLogger.info("===== Pool [" + objVclLoadBalancerPool.id + "] ===== Error Details: " + objVclLoadBalancerPool.errorDetails);
        this.objLogger.info("===== Pool [" + objVclLoadBalancerPool.id + "] ===== Operational: " + objVclLoadBalancerPool.operational);
        this.objLogger.info("============================================================");
    });

    arrVclLoadBalancerVirtualServer.forEach((objVclLoadBalancerVirtualServer: VclLoadBalancerVirtualServer): void => {

        this.objLogger.info("============================================================");
        this.objLogger.info("===== Virtual Server [" + objVclLoadBalancerVirtualServer.name + "] ===== Description: " + objVclLoadBalancerVirtualServer.description);
        this.objLogger.info("===== Virtual Server [" + objVclLoadBalancerVirtualServer.name + "] ===== IP: " + objVclLoadBalancerVirtualServer.ipAddress);
        this.objLogger.info("===== Virtual Server [" + objVclLoadBalancerVirtualServer.name + "] ===== Pool: " + objVclLoadBalancerVirtualServer.pool);
        this.objLogger.info("===== Virtual Server [" + objVclLoadBalancerVirtualServer.name + "] ===== Enabled: " + objVclLoadBalancerVirtualServer.isEnabled);
        this.objLogger.info("===== Virtual Server [" + objVclLoadBalancerVirtualServer.name + "] ===== Logging: " + objVclLoadBalancerVirtualServer.logging);
        this.objLogger.info("============================================================");
    });
}

Discover more from Cloud Build Tools

Subscribe to get the latest posts sent to your email.

You may also like