2.0.0p6 -> 2.0.0p7 api/1.0/domain-types/host_config/collections/all host Import mit tag_ klappt nicht mehr

Hallo zusammen,

mit den Versions update von 2.0.0p6 zu 2.0.0p7 hat sich etwas an der api geändert für einen host wurden die TAGs einen neuen orbjekt namens “effective_attributes” untergeordnet dadurch funktioniert der call der unter der Version 2.0.0p6 noch funktionierte nicht mehr leider ist nirgends etwas dokumentiert wie man damit umgehen kann. so das meine bisherigen Lösungsansätze nicht von erfolggekrönt waren.

Vielleicht kann mir ja jemand weiterhelfen.

außerdem wäre es hilfreich wenn Änderungen an den erwarteten Objekten irgendwo Dokumentiert wären oder darauf hingewiesen wird wenn siech diese ändern.

Danke schonmal

/check_mk/api/1.0/domain-types/host_config/collections/all

2.0.0p6

    {
        "attributes": {
            "ipaddress": "xxx.xxx.xxx.xxx",
            "tag_model": "XXXXXXX",
            "tag_iosType": "XXXXXXX",
            "tag_bitmask": "XXXXXXX",
            "tag_voice": "XXXXXXX",
            "tag_snmp_ds": "snmp-v2",
            "tag_sap": "XXXXXXX",
            "tag_iosVersion": "XXXXXXX",
            "tag_unit": "XXXXXXX",
            "tag_vendor": "XXXXXXX",
            "site": "XXXXXXX",
            "tag_loctype": "XXXXXXX",
            "tag_country": "XXXXXXX",
            "tag_category": "XXXXXXX",
            "tag_agent": "XXXXXXX",
            "tag_vlanid": "XXXXXXX",
            "tag_ports": "XXXXXXX",
            "snmp_community": {
                "type": "v1_v2_community",
                "community": "********"
            }
        },
        "folder": "/test",
        "host_name": "host"
    }

{
“title”: “Bad Request”,
“status”: 400,
“detail”: “These fields have problems: attributes”,
“fields”: {
“attributes”: {
“tag_loctype”: [
“Unknown field.”
],
“tag_model”: [
“Unknown field.”
],
“tag_unit”: [
“Unknown field.”
],
“tag_ports”: [
“Unknown field.”
],
“tag_vlanid”: [
“Unknown field.”
],
“tag_bitmask”: [
“Unknown field.”
],
“tag_iosType”: [
“Unknown field.”
],
“tag_voice”: [
“Unknown field.”
],
“tag_country”: [
“Unknown field.”
],
“tag_iosVersion”: [
“Unknown field.”
],
“tag_category”: [
“Unknown field.”
],
“tag_sap”: [
“Unknown field.”
],
“tag_vendor”: [
“Unknown field.”
]
}
}
}

2.0.0p7 variante 1

    {
        "attributes": {
            "ipaddress": "xxx.xxx.xxx.xxx",
            "snmp_community": {
                "type": "v1_v2_community",
                "community": "********"
            },
            "effective_attributes": [
            "ipaddress": "xxx.xxx.xxx.xxx",
            "tag_model": "XXXXXXX",
            "tag_iosType": "XXXXXXX",
            "tag_bitmask": "XXXXXXX",
            "tag_voice": "XXXXXXX",
            "tag_snmp_ds": "snmp-v2",
            "tag_sap": "XXXXXXX",
            "tag_iosVersion": "XXXXXXX",
            "tag_unit": "XXXXXXX",
            "tag_vendor": "XXXXXXX",
            "site": "XXXXXXX",
            "tag_loctype": "XXXXXXX",
            "tag_country": "XXXXXXX",
            "tag_category": "XXXXXXX",
            "tag_agent": "XXXXXXX",
            "tag_vlanid": "XXXXXXX",
            "tag_ports": "XXXXXXX"
            ]
        },
        "folder": "/test",
        "host_name": "host"
    }

{
“title”: “Bad Request”,
“status”: 400,
“detail”: “400 Bad Request: Failed to decode JSON object: Expecting ‘,’ delimiter: line 9 column 28 (char 297)”
}

2.0.0p7 variante 2

           {
        "attributes": {
        "attributes": {
            "ipaddress": "xxx.xxx.xxx.xxx",
            "snmp_community": {
                "type": "v1_v2_community",
                "community": "********"
            },
            "effective_attributes": {
            "ipaddress": "xxx.xxx.xxx.xxx",
            "tag_model": "XXXXXXX",
            "tag_iosType": "XXXXXXX",
            "tag_bitmask": "XXXXXXX",
            "tag_voice": "XXXXXXX",
            "tag_snmp_ds": "snmp-v2",
            "tag_sap": "XXXXXXX",
            "tag_iosVersion": "XXXXXXX",
            "tag_unit": "XXXXXXX",
            "tag_vendor": "XXXXXXX",
            "site": "XXXXXXX",
            "tag_loctype": "XXXXXXX",
            "tag_country": "XXXXXXX",
            "tag_category": "XXXXXXX",
            "tag_agent": "XXXXXXX",
            "tag_vlanid": "XXXXXXX",
            "tag_ports": "XXXXXXX"
            }
        },
        "folder": "/branch_network",
        "host_name": "lu-l501-sw-mr-01-02"
    }
	
	{

“title”: “Bad Request”,
“status”: 400,
“detail”: “These fields have problems: attributes”,
“fields”: {
“attributes”: {
“effective_attributes”: [
“Unknown field.”
]
}
}
}

Die REST API scheint noch nicht fertig zu sein, da gibt es immer wieder Änderungen, die alle im Changelog des jeweiligen Release stehen:

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.