Automatically Create CI Relationship Based on Reference Field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2018 08:40 AM
Hi All
Is it possible to create CI relationships based on a reference field within the CI? e.g.
Discovering Azure Storage Accounts, I have a reference field that is populated with the Resource Group CI that contains it. I would also like a relationship that identifies the storage account is dependent on the resource group.
For a VM I would like it to automatically create a relationship to the resource group that contains it, as well as the storage account that holds it's data. Both of which I can populate during discovery.
Thanks
Cam
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2018 08:58 AM
I've seen that relationships appear to be held in a table called cmdb_rel_ci. I'll see If I can use REST to create these, as that would fit in perfectly with what I'm doing.
I'll report back if I get anywhere.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2018 09:50 AM
Yes relationships are stored in the cmdb_ci_rel table. An easier method would be to create a business rule on your table that automatically creates the relationship on insert/update of the value in that reference field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-03-2018 01:39 AM
Great, thanks. I'll have a look.
Ta
Cam