UCMDB and UD Practitioners Forum (Previously CMS)
cancel

Running an enrichment in a script?

Highlighted
Everett Sumner
Valued Contributor.

Running an enrichment in a script?

We pull data from an external source and save CITs via a discovery adapter.  From it, we use an enrichment to build relationships.  (If there is a server with the name of the server attribute and there is a switch in the switch attribute, create a relationship from the server to the switch.)

 

If the server is connected to a new switch, or the server gets removed from the source, we no longer want the "old" relationship.

 

I don't want to simply remove all relationships before running my script, because of the possibility I can't connect to the source.  What I'd like to do is delete all of these relationships once I retrieve all of the data and I have over 'x' number of rows.

 

So I'd like to do one of two things:

- Have the script fire off the delete enrichment.  Once the relationships are deleted, the "create" enrichment will create new relationships based on the rows I've just retrieved.

- Have the delete enrichment only run based on a condition.

 

Any ideas how to do either of these?