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!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...