REST API - DELETE config/service config_name or host_name

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
drodiger
Posts: 2
Joined: Mon May 20, 2019 8:39 am

REST API - DELETE config/service config_name or host_name

Post by drodiger »

Hi,

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:

Dejan
drodiger
Posts: 2
Joined: Mon May 20, 2019 8:39 am

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

Post 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:

Dejan
Locked