From 2df4bee52518742b601f049082030009288b8758 Mon Sep 17 00:00:00 2001 From: Kamforka Date: Mon, 11 Nov 2024 19:32:14 +0100 Subject: [PATCH] #364 - Fix alert docs --- docs/examples/alert.md | 2 +- examples/alert/advanced.py | 22 +++++++++++++--------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/docs/examples/alert.md b/docs/examples/alert.md index 5e8e5f2..dce7946 100644 --- a/docs/examples/alert.md +++ b/docs/examples/alert.md @@ -77,7 +77,7 @@ In our example `attachment_key` is used to specify the relationship between the ## Update single and bulk -Sometimes an existing alert needs to be updated. TheHive offers multiple ways to accomplish this task either with a single alert or multiple ones. +Sometimes an existing alert needs to be updated. `thehive4py` offers multiple ways to accomplish this task either with a single alert or multiple ones. ### Update single diff --git a/examples/alert/advanced.py b/examples/alert/advanced.py index 29abfa0..abb1911 100644 --- a/examples/alert/advanced.py +++ b/examples/alert/advanced.py @@ -1,13 +1,17 @@ from thehive4py import TheHiveApi +from thehive4py.types.alert import InputAlert hive = TheHiveApi(url="http://localhost:9000", apikey="h1v3b33") -simple_alert = hive.alert.create( - alert={ - "type": "simple", - "source": "tutorial", - "sourceRef": "should-be-unique", - "title": "a simple alert", - "description": "a bit too simple", - } -) +input_alert: InputAlert = { + "type": "advanced", + "source": "tutorial", + "sourceRef": "should-be-unique", + "title": "an advanced alert", + "description": "a bit more advanced", + "tags": ["advanced", "example"], + "severity": 1, + "caseTemplate": "my-template", +} + +output_alert = hive.alert.create(alert=input_alert)