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

by Simon Sparks · 5 September 2013

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

publicVclAdminVdcLimitsGet(objVclHost:VclHost):void{
letobjVclQueryService: VclQueryService=objVclHost.getQueryService();

letobjVclExpression: VclExpression=newVclExpression(VclQueryAdminVdcField.NAME,"*",VclExpressionType.EQUALS);

letobjVclFilter: VclFilter=newVclFilter(objVclExpression);

letobjVclQueryParams: VclQueryParams=newVclQueryParams();
objVclQueryParams.setFilter(objVclFilter);

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

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

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