This commit is contained in:
funnywolf
2025-10-29 21:17:45 +08:00
parent 3ac9fac9db
commit bf27933882
2 changed files with 8 additions and 6 deletions
+2 -1
View File
@@ -3,7 +3,7 @@ from rest_framework import routers
from Automation.views import PlaybookView
from Core.views import BaseAuthView, CurrentUserView
from Forwarder.views import WebhookSplunkView, WebhookKibanaView
from Forwarder.views import WebhookSplunkView, WebhookKibanaView, WebhookNocolyMailView
router = routers.DefaultRouter(trailing_slash=False)
router.register(r'api/login/account', BaseAuthView, basename="BaseAuth")
@@ -11,6 +11,7 @@ router.register(r'api/currentUser', CurrentUserView, basename="CurrentUser")
router.register(r'api/v1/webhook/splunk', WebhookSplunkView, basename="WebhookSplunkView")
router.register(r'api/v1/webhook/kibana', WebhookKibanaView, basename="WebhookKibanaView")
router.register(r'api/v1/webhook/nocolymail', WebhookNocolyMailView, basename="WebhookNocolyMailView")
router.register(r'api/v1/automation/playbook', PlaybookView, basename="PlaybookView")
urlpatterns = [
re_path(r'^', include(router.urls)),
+6 -5
View File
@@ -4,10 +4,10 @@ from Lib.External.nocolyapi import WorksheetRow
from Lib.baseplaybook import BasePlaybook
class Module(BasePlaybook):
class Playbook(BasePlaybook):
def __init__(self, params):
super().__init__(params) # do not delete this code
def __init__(self):
super().__init__() # do not delete this code
def run(self):
worksheet = self.param("worksheet")
@@ -26,7 +26,8 @@ class Module(BasePlaybook):
if __name__ == "__main__":
params = {'playbook': 'TI_artifact_query_mock', 'rowid': 'c6caa5eb-b4af-44df-aa10-b94829243fd4', 'worksheet': 'Artifact'}
module = Module(params)
params_debug = {'playbook': 'TI_artifact_query_mock', 'rowid': 'a966036e-b29e-4449-be48-23293bacac5d', 'worksheet': 'Artifact'}
module = Playbook()
module._params = params_debug
result = module.run()
print(result)