Deployment Architecture

Unable to manipulate serverclass whitelist via REST

wegscd
Contributor

We're trying to script some whitelisting of hosts in serverclasses, hit a snag.

We create a test serverclass named 'posttest' with one app and nothing in the whitelist. When we try to add a host:

curl -x '' -k -u admin:xxxxxxx https://splunk-c-ds.local:8089/services/deployment/server/serverclasses/posttest -d whitelist.0=posted_host

we get this response

<?xml version="1.0" encoding="UTF-8"?>
<response>
  <messages>
    <msg type="ERROR">
 In handler 'serverclasses': bundle=serverclass stanza=serverClass:posttest The sourceApp=system doesn't equal callerApp=search</msg>
  </messages>
</response>

This appears to be the same issue seen by a212830 seen down in the notes for https://answers.splunk.com/answers/307335/why-am-i-getting-error-cannot-perform-action-post.html, no there is no solution posted there.

We're running 6.3.0.1.

0 Karma
1 Solution

wegscd
Contributor

Found my own answer. The POST endpoint is not always /services/deployment/server/serverclasses/classname

It's different for the different serverclasses (depends on what application you were in when dropped into forwarder management and added the server class). When POSTing changes, you need to use the endpoint listed in the href for the <link> that has rel="edit"

View solution in original post

ben_leung
Builder

Have you tried adding "reload" to the endpoint url?

/services/deployment/server/serverclasses//reload

0 Karma

wegscd
Contributor

Found my own answer. The POST endpoint is not always /services/deployment/server/serverclasses/classname

It's different for the different serverclasses (depends on what application you were in when dropped into forwarder management and added the server class). When POSTing changes, you need to use the endpoint listed in the href for the <link> that has rel="edit"

Get Updates on the Splunk Community!

Observability Highlights | January 2023 Newsletter

 January 2023New Product Releases Splunk Network Explorer for Infrastructure MonitoringSplunk unveils Network ...

Security Highlights | January 2023 Newsletter

January 2023 Splunk Security Essentials (SSE) 3.7.0 ReleaseThe free Splunk Security Essentials (SSE) 3.7.0 app ...

Platform Highlights | January 2023 Newsletter

 January 2023Peace on Earth and Peace of Mind With Business ResilienceAll organizations can start the new year ...