REST API - DELETE config/service config_name or host_name

Engage with the community of users including those using the open source solutions.
Includes Nagios Core, Plugins, and NCPA

REST API - DELETE config/service config_name or host_name

Postby drodiger » Thu Oct 07, 2021 3:20 am

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

Postby drodiger » Thu Oct 07, 2021 9:48 am

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
drodiger
 
Posts: 2
Joined: Mon May 20, 2019 8:39 am


Return to Community Support

Who is online

Users browsing this forum: Google [Bot] and 11 guests

cron