IRE Multiple Dependency issue

olson
Kilo Contributor

I am using the IRE API

i am sending a cmdb_ci_vm_instance it has two relationships, one to the cmdb_ci_virtualization_server and one to cmdb_ci_server

{
    "items": [{
        "values": {
            "install_status": 1,
            "name": "vm instance",
            "sys_class_name": "cmdb_ci_vm_instance",
            "manufacturer": null,
            "sys_id": "193d4605dbb2d050e590d1d3ca96192a",
            "cpu_manufacturer": null,
            "model_id": null
        },
        "className": "cmdb_ci_vm_instance"
    }, {
        "values": {
            "install_status": 1,
            "sys_class_name": "cmdb_ci_esx_server",
            "name": "esx server",
            "sys_id": "af88d2891bb690101c6afd9f034bcba0"
        },
        "className": "cmdb_ci_esx_server"
    }, {
        "values": {
            "sys_class_name": "cmdb_ci_win_server",
            "install_status": 1,
            "sys_id": "503d8a811bb690101c6afd9f034bcb81"
        },
        "className": "cmdb_ci_win_server"
    }],
    "relations": [{
        "parent": "0",
        "type": "Runs on::Runs",
        "child": "1"
    }, {
        "parent": "2",
        "type": "Runs on::Runs",
        "child": "0"
    }]
}

This causes an error ,

"errors": [
          {
            "error": "MULTIPLE_DEPENDENCIES",
            "message": "Found multiple dependent relation items [{\"parent\":2,\"child\":0,\"type\":\"Runs on::Runs\"}] and [{\"parent\":0,\"child\":1,\"type\":\"Runs on::Runs\"}] in payload"
          }
        ],

Both the win_server and the esx_server require a Runs on: Runs relationship with the vm_instance, and if i sent them individually with the vm_instance without the Runs on:: Runs it would fail with missing dependency, however if send them in a packet together they fail with multiple dependency.

How do i solve this issue?

2 REPLIES 2

Sudhanshu Talw1
Tera Guru

Error: MULTIPLE_DEPENDENCIES

Message Description and Resolution
Found multiple dependent relation items [xyz] and [abc] in payload
Description:
Multiple dependent relation items exist.
Resolution:
Remove one of the multiple dependent relation items [xyz] or [abc].
Multiple paths leading to the same destination: xyz -> abc
Description:
Multiple paths leading to the same destination.
Resolution:
Remove duplicate relationship/qualifier chains that might exists between xyz -> abc.

olson
Kilo Contributor

Thanks for your reply, i am fully aware of what the error means, but in this scenario both server and computer require a Runs on relationship

 

so if i sent the payload in separate items as such it works, as i satisfying the IRE rules

{
    "items": [{
        "values": {
            "install_status": 1,
            "name": "vm instance",
            "sys_class_name": "cmdb_ci_vm_instance",
            "manufacturer": null,
            "sys_id": "193d4605dbb2d050e590d1d3ca96192a",
            "cpu_manufacturer": null,
            "model_id": null
        },
        "className": "cmdb_ci_vm_instance"
    }, {
        "values": {
            "install_status": 1,
            "sys_class_name": "cmdb_ci_esx_server",
            "name": "esx server",
            "sys_id": "af88d2891bb690101c6afd9f034bcba0"
        },
        "className": "cmdb_ci_esx_server"
    }]
    "relations": [{
        "parent": "0",
        "type": "Runs on::Runs",
        "child": "1"
    }]
}

 

{
    "items": [{
        "values": {
            "install_status": 1,
            "name": "vm instance",
            "sys_class_name": "cmdb_ci_vm_instance",
            "manufacturer": null,
            "sys_id": "193d4605dbb2d050e590d1d3ca96192a",
            "cpu_manufacturer": null,
            "model_id": null
        },
        "className": "cmdb_ci_vm_instance"
    },{
        "values": {
            "sys_class_name": "cmdb_ci_win_server",
            "install_status": 1,
            "sys_id": "503d8a811bb690101c6afd9f034bcb81"
        },
        "className": "cmdb_ci_win_server"
    }],
    "relations": [{
        "parent": "1",
        "type": "Runs on::Runs",
        "child": "0"
    }]
}

 

However is i send them together as i would expect the point of this IRE API it fails, so either the rules doesnt make a lot of sense as you can create the exact multiple dependent relationship it doesnt like by splitting out the items.