vCO Workflow Script to Trigger vRA Data Collection using an OData Query

vCO Workflow Script to Trigger vRA Data Collection using an OData Query

 

var strHostID = objVCACHost.id;
var strModelName = "ManagementModelEntities.svc";
var strEntitySetName = "DataCollectionStatuses";
var strFilter = "FilterSpec/FilterSpecGroup/FilterSpecGroupName eq 'inventory' and FilterSpec/FilterSpecName eq 'vSphere'";
var strOrderBy = null;
var strSelect = null;
var strTop = null;
var strSkip = null;
var objLinks = null;
var objProperties = new Properties();
var arrProperties = { "LastCollectedTime":null };

var arrVCACEntity = vCACEntityManager.readModelEntitiesBySystemQuery(strHostID, strModelName, strEntitySetName, strFilter, strOrderBy, strSelect, strTop, strSkip, objProperties);

for ( var i = 0; i < arrVCACEntity.length; i++)
{
 var objVCACEntity = arrVCACEntity[i];

 vCACEntityManager.updateModelEntityBySerializedKey(strHostID, strModelName, strEntitySetName, objVCACEntity.keyString, arrProperties, objLinks, objProperties);
}

2 Comments

  1. udubplate February 19, 2017 5:59 pm  Reply

    Hello – Do you know how to do something similar, but to trigger a directory synchronization within vRA/vIDM? We have a workflow/XaaS that allows a user to add themselves to an AD group, but in order for it to be recognized by vRA a directory sync has to happen afterwards. There is no vRO workflow for a directory sync and no documented REST API or cloud client command.

    Cheers

    • System Admin May 10, 2017 9:27 am  Reply

      I don’t but I will have a look into this for you.

Leave a Reply