Hey,
I am looking for a way to change permissions to a saved search via splunk python SDK.
I tried using the splunklib.client post method:
import splunklib.client as client
app = "app_name"
cred = {"user": "admin", "password": "changeme", "port": 8089, "host": "localhost","owner":"admin"}
service = client.connect(app=app,**cred)
service.post('saved/searches/report_name/acl', sharing="app" )
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.6/site-packages/splunk_sdk-1.2.3-py2.6.egg/splunklib/binding.py", line 238, in wrapper
return request_fun(self, *args, **kwargs)
File "/usr/lib/python2.6/site-packages/splunk_sdk-1.2.3-py2.6.egg/splunklib/binding.py", line 62, in new_f
val = f(*args, **kwargs)
File "/usr/lib/python2.6/site-packages/splunk_sdk-1.2.3-py2.6.egg/splunklib/binding.py", line 657, in post
response = self.http.post(path, all_headers, **query)
File "/usr/lib/python2.6/site-packages/splunk_sdk-1.2.3-py2.6.egg/splunklib/binding.py", line 1089, in post
return self.request(url, message)
File "/usr/lib/python2.6/site-packages/splunk_sdk-1.2.3-py2.6.egg/splunklib/binding.py", line 1109, in request
raise HTTPError(response)
splunklib.binding.HTTPError: HTTP 404 Not Found --
In handler 'savedsearch': Could not find object id=report_name
When i try using curl i get no problem:
curl -k -u admin:changeme https://localhost:8089/servicesNS/admin/app_name/saved/searches/report_name/acl -d sharing=app
Maybe i am doing something wrong? Or maybe there is other way to do it and i am missing it?
Regards,
Dori
... View more