Getting Data In

update default.meta stanzas using REST API

ganesh_crms
New Member

Hi All,
How to update default.meta stanzas using REST API. Thanks in Advance.

0 Karma
1 Solution

harsmarvania57
Ultra Champion

Hi,

To change views permissions using REST API, you can use below REST API (In below example please change values for <> based on your environment.

To change permissions of particular dashboard

curl -vk -u user:password https://<your_splunk_server>:8089/servicesNS/<username>/<app_name>/data/ui/views/<dashboard_name>/ac... -d "perms.read"="user" -d "perms.write"="user" -d sharing=<app/user/global> -d owner=<owner_name>

To change permissions of dashboards page, try below REST API.

curl -vk -u user:password https://<your_splunk_server>:8089/servicesNS/nobody/<app_name>/data/ui/views/_acl -d "perms.read"="user" -d "perms.write"="user" -d sharing=<app/user/global>

View solution in original post

0 Karma

harimadambi
Explorer

import requests

data = {
'owner' : '<owner>',
'sharing' : '<app/global/system>',
'perms.read' : '*',
'perms.write' : '*'
}

url = 'https://<hostname>:8089/services/apps/local/test_app/acl'
response = requests.post(url, data=data, verify=False, auth=('admin', '<password>'))

harsmarvania57
Ultra Champion

Hi,

To change views permissions using REST API, you can use below REST API (In below example please change values for <> based on your environment.

To change permissions of particular dashboard

curl -vk -u user:password https://<your_splunk_server>:8089/servicesNS/<username>/<app_name>/data/ui/views/<dashboard_name>/ac... -d "perms.read"="user" -d "perms.write"="user" -d sharing=<app/user/global> -d owner=<owner_name>

To change permissions of dashboards page, try below REST API.

curl -vk -u user:password https://<your_splunk_server>:8089/servicesNS/nobody/<app_name>/data/ui/views/_acl -d "perms.read"="user" -d "perms.write"="user" -d sharing=<app/user/global>
0 Karma

harsmarvania57
Ultra Champion

Hi,

Can you please provide more information about what you would like to change in .meta files ? Additionally it is not good idea to change anything in default.meta because it will overwrite when you upgrade the app/add-on, so best practice is to change permissions in local.meta file.

0 Karma

ganesh_crms
New Member

Hi Harsmarvania,
Thanks for your answer.
whats the use of this parameter "-d sharing=".
What value i should pass?

0 Karma

harsmarvania57
Ultra Champion

sharing means would you like to share this dashboard at user level (Private), app level or global level ?

0 Karma

ganesh_crms
New Member

Hi,
I wants to modify the "access" field (under stanzas) to restrict role base access for a view in app

0 Karma

harsmarvania57
Ultra Champion

Under which stanza ?

0 Karma

ganesh_crms
New Member

---Current---
[views/]
access = read : [ admin ], write : [ admin ]

----Expected---
[views/]
access = read : [ user], write : [user ]

0 Karma
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...