Splunk Dev

Create REST API in app Namespace?

Kronecker
Loves-to-Learn

Hi, 

I am creating REST API'S for fetching data from an external server. I was able to successfully create the API.

Question/Problem:

I have two apps on the same Splunk instance

1) Development

2) Production

Both of them have a similar code for the REST API's. 

in restmap.conf

[script:build]

match=/build

script=build.py

scripttype=persist

handler=application.build

When I call the REST API from either Development or Production application the call is being made to the API in Development application.

I have tried using serviceNS/<app_name>/<user_name>/<rest_endpoint> 

But the calling is still being made to the API under Development.

How can I create the REST API in a such a way that it belongs to the APPs namespace.

P.S.

I need to keep the code same for both Production and Development application.

Labels (2)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

It is generally not good practice to keep development and production on the same instance.

You should consider some sort of build and delivery pipeline for deploying your code from development to production to "keep the code the same".

0 Karma
Get Updates on the Splunk Community!

Splunk Platform | Upgrading your Splunk Deployment to Python 3.9

Splunk initially announced the removal of Python 2 during the release of Splunk Enterprise 8.0.0, aiming to ...

From Product Design to User Insights: Boosting App Developer Identity on Splunkbase

co-authored by Yiyun Zhu & Dan Hosaka Engaging with the Community at .conf24 At .conf24, we revitalized the ...

Detect and Resolve Issues in a Kubernetes Environment

We’ve gone through common problems one can encounter in a Kubernetes environment, their impacts, and the ...