Orchestrator Function: Find a VCACEntity objects for HostReservations

by Simon Sparks · 27 January 2026

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

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

Filename: vRealizeAutomation.ts

Function getReservations

Description: The following code finds VCACEntity objects for HostReservations.

publicgetReservations ():VCACEntity[]
{
letstrFilter:string=``;
letstrExpand:string=null;
letstrOrderBy:string=null;
letstrSelect:string=null;
letintTop:number=null;
letintSkip:number=0;
letobjPropertiesHeaders:Properties=newProperties();

letarrVCACEntity:VCACEntity[]=vCACEntityManager.readModelEntitiesBySystemExpandQuery(this.objVCACHost.id,"ManagementModelEntities.svc","HostReservations",strFilter,strExpand,strOrderBy,strSelect,intTop,intSkip,objPropertiesHeaders);

arrVCACEntity=arrVCACEntity.filter((objVCACEntity:VCACEntity):boolean=>{returnobjVCACEntity.getProperty("HostReservationName").length===53&&objVCACEntity.getProperty("HostReservationName").substring(0,5)===this.strTenantID;});

returnarrVCACEntity;
}

Discover more from Cloud Build Tools

Subscribe to get the latest posts sent to your email.

You may also like