Force a vRA Data Collection

// inputs clusterID
// vcacHost

var modelName = 'ManagementModelEntities.svc';
var entitySetName = 'DataCollectionStatuses';

//Read a list of entities
var entities = vCACEntityManager.readModelEntitiesByCustomFilter(host.id, modelName, entitySetName, null, null);


for each (entity in entities) {
	var entityKey = entity.keyString;
	if (entity.getProperty("EntityID").toLowerCase() == clusterID.toLowerCase()){
      System.log("ClusterID: " + entity.getProperty("EntityID"));
      //System.log("Updating entity with key: " + entityKey);
	  var links = null;
	  var headers = null;
	  var updateProperties = {
      		"LastCollectedTime":null
      };
	
	vCACEntityManager.updateModelEntityBySerializedKey(host.id, modelName, entitySetName, entityKey, updateProperties, links, headers);
    }
}

Posted

in

, , , ,

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *