I want to know if there's an API to add a new server (app05) to serverClass:Legacy_App and it will auto generate the next whitelist.# number?
I don't want to specify whitelist.2=legacy305 in the api because I will have a lot of servers in Legacy_App, can't remember what the next whitelist number every time I try to add a new server.
[serverClass:Legacy_App] whitelist.0=legacy105 whitelist.1=legacyapp205 whitelist.2=app305 want to be automatic ( no need to specify whitelist.2)
Yes there is the endpoint
curl -k -u admin:pass https://localhost:8089/services/deployment/server/serverclasses -d name=scappsombra
this curl -k -u admin:pass https://localhost:8089/services/deployment/server/serverclasses -d name=scappsombra is for creating serverclass.
there's a request parameter for whitelist* but i have to specify an ordinal number.
whitelist. String List of hosts to accept for this server class. For each whitelist, replace with an ordinal number to specify additional whitelists. Filter ordinals must start at 0 and be consecutive.
is there a way to add whitelist.* automatically with consecutive number?
That's what I want to know. I have read a few REST API posts on here and I still don't see an answer. Please post if you figured this out. Having ordinals in the serverclass may have made sense at one point but now with those of us wanting to automate this is a challenge.
Unfortunately the lack of answer for this required me to work in the other direction.
I created an app that included a script to run against the inventory system's API to create a text file of the "active" assets. The serverclass is then setup through serverclass.conf to ingest that file for the list of active assets.
#serverclass.conf [serverClass:illinois_urbana_smg_techsvc] whitelist.from_pathname = etc/apps/illinois-urbana-splunkmgmt-deploymentserver-SMG-serverlist-APP/lookup/smg_active_server_list
It would be great if I could have figured out how to just add a single server to an existing server class without having to build something external.