1

Orchestrator Function: Trigger vRA Data Collection using an OData Query

by Simon Sparks · 16 February 2017

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

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

Filename: AriaAutomationService.ts

Description: Trigger vRealize / Aria Automation Data Collection using an OData Query

Function TriggerDataCollection

public TriggerDataCollection(objVCACHost:vCACHost):void {
  let strHostID:string = objVCACHost.id;
  let strModelName:string = "ManagementModelEntities.svc";
  let strEntitySetName:string = "DataCollectionStatuses";
  let strFilter:string = "FilterSpec/FilterSpecGroup/FilterSpecGroupName eq 'inventory' and FilterSpec/FilterSpecName eq 'vSphere'";
  let strOrderBy:string = null;
  let strSelect:string = null;
  let strTop:string = null;
  let strSkip:string = null;
  let objLinks = null;
  let objProperties = new Properties();
  let arrProperties: { LastCollectedTime:any } = { LastCollectedTime:null };
  
  let arrVCACEntity:VCACEntity[]  = vCACEntityManager.readModelEntitiesBySystemQuery(strHostID, strModelName, strEntitySetName, strFilter, strOrderBy, strSelect, strTop, strSkip, objProperties);
  
  arrVCACEntity.forEach((objVCACEntity:VCACEntity):void => {
  
    vCACEntityManager.updateModelEntityBySerializedKey(strHostID, strModelName, strEntitySetName, objVCACEntity.keyString, arrProperties, objLinks, objProperties);
  
  });
}

Discover more from Cloud Build Tools

Subscribe to get the latest posts sent to your email.

You may also like