- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-26-2022 08:58 AM
Hi,
when trying to create a CI (of class cmdb_ci_apache_web_server), the API call fails with the "error": "MISSING_DEPENDENCY".
The related message is "In payload no relations defined for dependent class [cmdb_ci_apache_web_server] that matches any containment/hosting rules: [cmdb_ci_appl >> Runs on >> cmdb_ci_hardware]."
Following is the body of the call:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2023 03:20 AM
In the meantime I have found another post, here on community that helped me in the right direction, and I have managed to do the CI creation using payload:
{
"attributes": {
"asset_tag": "tag_lx_web_app40",
"company": "ServiceNow",
"config_file": "/etc/httpd/httpd.conf",
"environment": "dev",
"name": "Apache Server @ lx_web_app40",
"type": "Apache",
"tcp_port": "80",
"version": "2.4.54"
},
"depends_on": {
"outbound_relations": {
"type": "60bc4e22c0a8010e01f074cbe6bd73c3",
"target": "539747cac0a801640163e60735fbbf6e"
}
},
"source": "ServiceNow"
}
It seems there is a total disconnect between what exists and what is described in the documentation 😞
It seems in case of depending CIs one has to add an additional property to the payload: depends_on. And it has to contain the relationship that indicates the parent CI. As you can see you still have to add outbound relation, not an inbound one. Oh, for sure you will need to update "target" of "outbound_relations" to be that of the Linux (or whatever) server you have in your CMDB.
Here's the Linux server before calling the API:
and here it is after calling the API:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2023 03:23 AM
Also, note that property "attributes" must contain the field names (config_file) not the field labels (Configuration file)!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2022 07:58 AM
I would also make sure to provide all information necessary for a successful identification:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-02-2023 10:49 PM
Hi,
thanks for the info
I've tried specifying the relationship as outbound, and added the three additional attributes, but with the same result
This is how the payload looks now:
The response is '400 Bad Request', indicating there's no relations defined.
So it looks like there is something missing in the definition of the outboud_relations in the payload.
kr
Geert
kr
Geert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2023 02:30 AM
The docs say that one must provide the parent sys_id in the payload when creating dependent CIs. However it does not say how to add that info to the payload.
Maybe ask that in the community in another question - people tend to hunt not-yet-unswered question, so I'm guessing no-one will look at this long thread - no points in sight :-).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2023 03:20 AM
In the meantime I have found another post, here on community that helped me in the right direction, and I have managed to do the CI creation using payload:
{
"attributes": {
"asset_tag": "tag_lx_web_app40",
"company": "ServiceNow",
"config_file": "/etc/httpd/httpd.conf",
"environment": "dev",
"name": "Apache Server @ lx_web_app40",
"type": "Apache",
"tcp_port": "80",
"version": "2.4.54"
},
"depends_on": {
"outbound_relations": {
"type": "60bc4e22c0a8010e01f074cbe6bd73c3",
"target": "539747cac0a801640163e60735fbbf6e"
}
},
"source": "ServiceNow"
}
It seems there is a total disconnect between what exists and what is described in the documentation 😞
It seems in case of depending CIs one has to add an additional property to the payload: depends_on. And it has to contain the relationship that indicates the parent CI. As you can see you still have to add outbound relation, not an inbound one. Oh, for sure you will need to update "target" of "outbound_relations" to be that of the Linux (or whatever) server you have in your CMDB.
Here's the Linux server before calling the API:
and here it is after calling the API:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2023 05:43 AM
thanks,
I have seen that post as well but thought the 'depends_on' had to be replaced by the type of relationship, which in my case was 'RunsOn', but for which I didn't find any proper spelling...
Thanks for the help !