Function: Get Organisational Virtual Data Centers Resource Allocation, Limits and Usage

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 get Organisational Virtual Data Centers Resource Allocation, Limits and Usage.

Function VclAdminVdcLimitsGet

public VclAdminVdcLimitsGet(objVclHost: VclHost): void {
    let objVclQueryService: VclQueryService = objVclHost.getQueryService();

    let objVclExpression: VclExpression = new VclExpression(VclQueryAdminVdcField.NAME, "*", VclExpressionType.EQUALS);

    let objVclFilter: VclFilter = new VclFilter(objVclExpression);

    let objVclQueryParams: VclQueryParams = new VclQueryParams();
    objVclQueryParams.setFilter(objVclFilter);

    let objVclAbstractRecordResultSet: VclAbstractRecordResultSet = objVclQueryService.queryRecords(VclQueryRecordType.ADMINORGVDC, objVclQueryParams);

    if (objVclAbstractRecordResultSet == null) {
        throw "No matching Org vDC found.";
    }
    else {
        let arrVclQueryResultAdminVdcRecord: VclQueryResultAdminVdcRecord[] = objVclAbstractRecordResultSet.getRecords(new VclQueryResultAdminVdcRecord());

        arrVclQueryResultAdminVdcRecord.forEach((objVclQueryResultAdminVdcRecord: VclQueryResultAdminVdcRecord) => {

            this.objLogger.info("===========================================================================");
            this.objLogger.info("orgVdc = " + objVclQueryResultAdminVdcRecord.name);
            this.objLogger.info("===========================================================================");
            this.objLogger.info("cpuAllocationMhz = " + objVclQueryResultAdminVdcRecord.cpuAllocationMhz);
            this.objLogger.info("cpuLimitMhz = " + objVclQueryResultAdminVdcRecord.cpuLimitMhz);
            this.objLogger.info("cpuUsedMhz = " + objVclQueryResultAdminVdcRecord.cpuUsedMhz);
            this.objLogger.info("===========================================================================");
            this.objLogger.info("memoryAllocationMB = " + objVclQueryResultAdminVdcRecord.memoryAllocationMB);
            this.objLogger.info("memoryLimitMB = " + objVclQueryResultAdminVdcRecord.memoryLimitMB);
            this.objLogger.info("memoryUsedMB = " + objVclQueryResultAdminVdcRecord.memoryUsedMB);
            this.objLogger.info("===========================================================================");
            this.objLogger.info("storageAllocationMB = " + objVclQueryResultAdminVdcRecord.storageAllocationMB);
            this.objLogger.info("storageLimitMB = " + objVclQueryResultAdminVdcRecord.storageLimitMB);
            this.objLogger.info("storageUsedMB = " + objVclQueryResultAdminVdcRecord.storageUsedMB);
            this.objLogger.info("===========================================================================");

        });
    }
}

Discover more from Cloud Build Tools

Subscribe to get the latest posts sent to your email.

You may also like