WORKAROUND
Run the following groovy script to delete stale UDC objects.
Update the typeName field to include the name of the Topology Object to remove (for example if the UDC name is GetSQLServerLogins, then the typename would be
def typeName = "DBSS_Cust_GetSQLServerLogins";
Set the staleAge to equal the number of days before a Topology object is considered stale.
def typeName = "DBSS_Cust_GetSQLServerLogins";
def staleAge = 1;
def force = "force";
def dataSvc = server.get("DataService");
def topSvc = server.get("TopologyService");
def objects = server.get("QueryService").queryTopologyObjects(typeName);
println(objects);
def staleTime = System.currentTimeMillis() - (staleAge * 60 * 60 * 1000L);
def staleObjects = [];
objects.each({ if (it.lastUpdated.time < staleTime) staleObjects << it });
println(staleObjects);
def output = new StringBuilder();
output.append("Stale objects:\n");
for (obj in staleObjects) {
output.append(obj.longName).append('\t');
output.append(obj.lastUpdated).append('\t')
output.append('\n');
}
// Delete the objects if force is given
if (force=='force') {
def batchSize = 100;
def idx = 0;
while (idx < staleObjects.size()) {
def endPos = Math.min(idx + batchSize, staleObjects.size());
def batch = staleObjects.subList(idx, endPos);
topSvc.deleteObjects(new HashSet(batch));
idx = endPos;
}
output.append("\n*** Successfully deleted " + staleObjects.size() + " stale objects. ***");
} else {
output.append("\n*** No objects deleted (use force argument to actually delete objects) ***");
}
println(output);
return objects.size();
STATUS
Enhancement Request FOGGENERAL-I-191 has been created to add UI functionality to delete stale UDC objects. This will be reviewed by Product Management for consideration in a future release of Foglight.
© ALL RIGHTS RESERVED. Terms of Use Privacy Cookie Preference Center