Tufin / pytos

A Python SDK for Tufin Orchestration Suite
https://www.tufin.com
Apache License 2.0
55 stars 21 forks source link

SecureTrack Device Objects ignore the parent_id result of the REST Endpoint #28

Open grepusername opened 5 years ago

grepusername commented 5 years ago

It would be highly useful to have the parent_id available when using the SecureTrackHelper.get_deviceby(name|id|.*) methods.

As it is the REST API returns:

{
    "device": {
        "id": "1111",
        "name": "Name",
        "vendor": "VMware",
        "model": "nsx_fw",
        "domain_id": "11",
        "domain_name": "Domain X",
        "offline": false,
        "topology": true,
        "module_uid": "",
        "ip": "192.168.23.5",
        "latest_revision": "1408",
        "parent_id": 1110,
        "virtual_type": "context"
    }
}

However the Device.from_xml_node and Device.init methods both completely ignore this field, though xml_tags.Elements.PARENT_ID exists. Given the nature of the Device.get_parents_recursive method it appears that the Device._parent attribute is intended to be another rich object rather than the simple id.