Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#364 - Fix alert docs #365

Merged
merged 1 commit into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Loading