Page 1 of 1

REST API - DELETE config/service config_name or host_name

PostPosted: Thu Oct 07, 2021 3:20 am
by drodiger

There are 2 REST API calls for DELETE config/service under Config Reference in Help section ( Nagios XI 5.7.4 - older version).

1. DELETE .../config/service?host_name=testapihost&service_description=PING&applyconfig=1

2. DELETE .../config/service/<config_name>/<service_description>?applyconfig=1

Question is: which one is correct? Using host_name to delete service or using config_name in delete service? Because GET operation uses config_name as optional parameter and host_name is not mentioned.

DELETE config/service or config/service/<config_name>/<service_description>, because under required parameters mentions host_name and service_description. config_name is not mentioned, which is confusing.

Can I use name of host_name as case INsensitive? Admins are sometimes using upper case and sometimes lower case :roll:


Re: REST API - DELETE config/service config_name or host_nam

PostPosted: Thu Oct 07, 2021 9:48 am
by drodiger
To answer myself...
Input is host_name and service_description.

Second option is incorrect in the help.
Second version works, but with url as /config/service/<host_name>/<service_description>

Whole URL should probably be encoded, in case your service description uses special characters... like : in Disk C: