Dashboards & Visualizations

How to move the App a Dashboard (view) belongs to via REST API?

marrette
Path Finder

Hi all,

Is it possible to move a dashboard (view) from belonging to one app to another via the REST API? I have an app called 'Eddie's Test App' and I would love to move it from the Search app to the MyApp app.

I know I can do this via the Settings menu -> Views -> find it on the list and then choose Move and select which app to move it to — this works.

So, I would assume that I should be able to do this via the REST API, after all I can see it by browsing the API:

https://myserver:8089/servicesNS/nobody/-/data/ui/views/eddies_test_app

Which shows it has a property called eai:appName that is set to the app it belongs to (and changes when I move it via the GUI).

But when I try to do a cURL request to make the change, it fails. If I try:

curl -X POST -k -u un:pw https://nzsplunk.globaltest.anz.com:8089/servicesNS/nobody/search/data/ui/views/eddies_test_app \
-d user=nobody \
-d app=MyApp

This fails with the message:

In handler 'views': Argument "appName" is not supported by this handler.

I've tried leaving out the user data, using the GET method and using eai:appName or appName instead of app — all fail with the same message.

Does anyone have a solution for this?

Thanks
Eddie

Tags (2)
0 Karma
1 Solution

harsmarvania57
Ultra Champion

Hi,

You need to use /move to move knowledge objects from one app to another app.

Try this

curl -X POST -k -u un:pw https://nzsplunk.globaltest.anz.com:8089/servicesNS/nobody/search/data/ui/views/eddies_test_app/move -d user=nobody -d app=yourapp

View solution in original post

0 Karma

harsmarvania57
Ultra Champion

Hi,

You need to use /move to move knowledge objects from one app to another app.

Try this

curl -X POST -k -u un:pw https://nzsplunk.globaltest.anz.com:8089/servicesNS/nobody/search/data/ui/views/eddies_test_app/move -d user=nobody -d app=yourapp
0 Karma

marrette
Path Finder

Thanks - this worked perfectly.

0 Karma

harsmarvania57
Ultra Champion

Welcome 🙂

0 Karma
Get Updates on the Splunk Community!

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...