Skip to content

Commit

Permalink
Merge pull request #365 from TheHive-Project/364-fix-alert-docs
Browse files Browse the repository at this point in the history
#364 - Fix alert docs
  • Loading branch information
Kamforka authored Nov 11, 2024
2 parents b3162f6 + 2df4bee commit 7f7685e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion docs/examples/alert.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
22 changes: 13 additions & 9 deletions examples/alert/advanced.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 7f7685e

Please sign in to comment.