Bug in ibmsecurity/isam/base/extensions.py, doesn't match what ISAM REST API is expecting
jv297v opened this issue · 6 comments
This python file is out of date, and does not match what the ISAM REST API is expecting. I'm assuming that a newer version of ISAM changed how this REST API is handled, and the extensions.py file was not updated to match it. When trying to use this API, I get the following error message: "Error> action does not have the right set of arguments or there is a code bug!"
I have ensured that my arguments are correct, and I have found that the extesnions.py file is not matching with what the REST API is expecting. First the code is doing a POST when the REST API is expecting a PUT. It is posting to /extensions/{extId} when ISAM is expecting a PUT to just /extensions (no extId in the URL). Then for the data, the python code is posting a parameter "third_party_package" while the ISAM REST API is expecting "extension_support_package". This is just what I have identified, and there may be further issues.
While the document has Put and extension_support_package, the LMI is actually calling Post and using third_party_package during update. The issue might be with the document.
Hm, in that case I am unsure why I am still getting errors when I try to run a playbook utilizing this API. If the documentation is incorrect, can you tell me what data/format is expected to be used when making this call?
To call ibmsecurity.isam.base.extensions.update and updating an already installed glowroot as the example, the input values would be:
extId="glowrootAgent"
config_data = '"collectorHost":"123.456.78.9","collectorPort":"9042","collectorAgentID":"demo2"'
third_party_package = "/home/user/Downloads/glowroot-0.13.6-dist.zip"
That is exactly how I am calling it, but it is giving the error: "Error> action does not have the right set of arguments or there is a code bug!". I have tried on ISAM 9.0.7.1 and 10.0.3.1 and I get the same result on both.
I tried ibmsecurity.isam.base.extensions.update from a python script with the example input values and it worked for me. If you are having an issue with playbooks or roles, could you open an issue in isam-ansible-collection with the example playbook and the input values.
Closed by #369