Splunk Dev

@route decorator - path was not found

jamesaarondevli
Path Finder

Hi guys,

I've been putting together a custom Splunk module and encountered some trouble trying to make one of my module handlers methods available via a URI. I have been trying to make the method available by using the @route decorator as per the below.

@route('/:action=setAlarmState')
def setAlarmState():
       logger.info('setAlarmState reached for alarm')

I am then trying to access this method via the following URL:

http://localhost:8443/en-US/module/system/Splunk.Module.AlarmManager/setAlarmState

Any advice as to how this ought to be done would be great.

EDIT - My handler class inherits from ModuleHandler, if that information is of any use.

Cheers,
James

0 Karma

jamesaarondevli
Path Finder

I wound up placing the additional end points into a controller class. This seemed to work fine, it would be nice to keep that code in the same class though.

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...