Icinga / icinga-doc

Icinga 1.x documentation in Docbook (EOL)
https://www.icinga.org/download/
4 stars 9 forks source link

[dev.icinga.com #4970] icinga web rest api updates #425

Closed icinga-migration closed 10 years ago

icinga-migration commented 10 years ago

This issue has been migrated from Redmine: https://dev.icinga.com/issues/4970

Created by mfriedrich on 2013-10-29 21:50:13 +00:00

Assignee: Wolfgang Status: Closed (closed on 2014-03-07 10:29:04 +00:00) Target Version: 1.11 Last Update: 2014-03-07 10:29:04 +00:00 (in Redmine)

Icinga Version: 1.10.0

it's obviously wrong/has changed in recent versions.

20:15:03 < quickdry21> Hey, I'm trying to get the REST API going. Trying this URL 
http://example.com/icinga-web/web/api/service/filter[AND(HOST_CURRENT_STATE|=|0;OR(SERVICE_CURRENT_STATE|=|1;SERVICE_CURRENT_STATE|=|2))]columns(SERVICE_NAME|HOST_NAME|SERVICE_CURRENT_STATE|HOST_NAME|HOST_CURRENT_STATE|HOSTGROUP_NAME)order(SERVICE_CURRENT_STATE;DESC)/authkey=supersecret/json - I get {"result":[[],[],[],[]],"success":"true"} - proper number of 
                       hosts but no columns
20:15:03 < quickdry21> returned. Any thoughts?
20:18:44 < quickdry21> NVM. Figured it out. Documentation is wrong in two places - columns needs [] brackets, not (). columns needs to be separated by a / - this one worker 
http://example.com/icinga-web/web/api/service/filter[AND(HOST_CURRENT_STATE|=|0;OR(SERVICE_CURRENT_STATE|=|1;SERVICE_CURRENT_STATE|=|2))]/columns[SERVICE_NAME|HOST_NAME|SERVICE_CURRENT_STATE|HOST_NAME|HOST_CURRENT_STATE|HOSTGROUP_NAME]/authkey=supersecret/json

places to be corrected:

please ask web devs for details.

icinga-migration commented 10 years ago

Updated by bstaz on 2013-12-11 18:54:06 +00:00

I ran into this as well. I actually began working with the API in 1.9.1, and then upgraded to 1.10 thinking that would fix my problem. Unfortunately I cannot go back and re-verify on 1.9.1.

In both docs listed the "Parameters in detail" section is correct, but the "Example for GET" has parenthesis instead of brackets. I feel like most people are going to copy that example to get started as I did, and unfortunately, completely miss the accurate details section.

icinga-migration commented 10 years ago

Updated by mfriedrich on 2013-12-11 20:49:51 +00:00

icinga-migration commented 10 years ago

Updated by Wolfgang on 2013-12-12 13:22:08 +00:00

Commit ff9afcbf3fd791011a8ff7430a271a31b4c6d947 in master

icinga-migration commented 10 years ago

Updated by mfriedrich on 2014-03-07 10:29:04 +00:00