Page 1 of 1
Undocumented REST API change
Posted: Mon Jul 23, 2018 10:19 am
by johncwelch
Okay, so I don't know why this isn't documented, but when you're using the GET objects/host command, with 5.5.1, the return has changed. In 5.4.13, the return you get for that command is:
"hostlist": {
"recordcount": "168",
"host": [
{
With 5.5.x (I'm not sure if this is 5.5.0 or 5.5.1, I'm testing 5.5.1 right now) you get:
"recordcount": "33",
"host": [
{
This causes all kinds of errors since you've changed the hierarchy of the JSON return records. If this was intentional, then please pay more attention to documenting this kind of thing. If this was not, then it's a rather large bug.
Re: Undocumented REST API change
Posted: Mon Jul 23, 2018 10:33 am
by johncwelch
This also happens with objects/contact
Re: Undocumented REST API change
Posted: Mon Jul 23, 2018 10:37 am
by johncwelch
and objects/hostgroup
Re: Undocumented REST API change
Posted: Mon Jul 23, 2018 10:48 am
by lmiltchev
If this was intentional, then please pay more attention to documenting this kind of thing. If this was not, then it's a rather large bug.
I just had a word from our developers, who confirmed that this change was intentional. The documentation will be updated in 5.5.2, which should be coming out soon.
Re: Undocumented REST API change
Posted: Mon Jul 23, 2018 11:57 am
by johncwelch
lmiltchev wrote:If this was intentional, then please pay more attention to documenting this kind of thing. If this was not, then it's a rather large bug.
I just had a word from our developers, who confirmed that this change was intentional. The documentation will be updated in 5.5.2, which should be coming out soon.
Okay. Can y'all please not just change stuff without documenting it? doing the error trapping wasn't hard, but not knowing why I was getting errors that made no sense and worked on 9 other servers is a bit frustrating.
APIs can't just arbitrarily change without notice like that, not if you want people to use and rely on them.
Re: Undocumented REST API change
Posted: Mon Jul 23, 2018 12:27 pm
by jomann
I understand it causes issues to have changes like this happen. You're right the docs should have been updated, and we try to make sure we catch everything but sometimes it doesn't get caught.
As for the changes in the API, this is one of the biggest releases of XI we've ever had. A lot changed behind the scenes, and the change is related to some back-end changes that were needed to improve usability and stability in XI, and it happened to remove the list portion of the object.
Re: Undocumented REST API change
Posted: Wed Aug 08, 2018 1:41 pm
by johncwelch
okay, another one. I notice in Fusion that I can add AD/LDAP users, but when I go to look in the help for REST APIs in Nagios XI 5.5.2, there's no documentation/help for adding users at all. Is this going to be changed soon?
Re: Undocumented REST API change
Posted: Thu Aug 09, 2018 9:56 am
by lmiltchev
I was told by @jomann that the documentation for adding AD/LDAP users will be added to the next release of Fusion. Currently, there is an example, showing how to add a "local" user only.
Adding AD/LDAP users is done is a similar way. Here's a couple of examples:
Code: Select all
curl -XPOST "http://x.x.x.x/nagiosfusion/api/v1/system/user?apikey=5ljksid8krdibrv2eo6jaa8vadij47d8ptqmd7r2v8jb3hce7h2go9d2mtkn4vvs&pretty=1" -d "username=jmcdouglas&password=test&name=Jordan%20McDouglas&email=jmcdouglas@localhost&dateformat=1&number_format=1&auth_level=user&auth_server_id=5a7b3b87cdc4e&allow_local=0&ad_username=jmcdouglas&email_info=0&auth_type=ad"
curl -XPOST "http://x.x.x.x/nagiosfusion/api/v1/system/user?apikey=5ljksid8krdibrv2eo6jaa8vadij47d8ptqmd7r2v8jb3hce7h2go9d2mtkn4vvs&pretty=1" -d "username=jmcdouglas&password=test&name=Jordan%20McDouglas&email=jmcdouglas@localhost&dateformat=1&number_format=1&auth_level=user&auth_server_id=5a7b3b950fd7f&allow_local=0&ldap_dn=cn%3Djmcdouglas%2Cou%3DTeam%2Cdc%3DNagios%2Cdc%3Dcom&email_info=0&auth_type=ldap"
Hope this helps.