-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bd9522f
commit a8a0f6b
Showing
89 changed files
with
28,076 additions
and
334 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,24 @@ | ||
from flask import Blueprint | ||
from flask import jsonify | ||
|
||
from app.services.WazuhIndexer.alerts import AlertsService | ||
|
||
bp = Blueprint("alerts", __name__) | ||
|
||
|
||
@bp.route("/alerts", methods=["GET"]) | ||
def get_alerts(): | ||
def get_alerts() -> jsonify: | ||
""" | ||
Endpoint to list all available alerts. | ||
It processes each alert to verify the connection and returns the results. | ||
Retrieves all alerts from the AlertsService. | ||
This endpoint retrieves all available alerts from the AlertsService. It does this by creating an instance of | ||
the AlertsService class and calling its `collect_alerts` method. The result is a list of all alerts currently | ||
available. | ||
Returns: | ||
json: A JSON response containing the list of all available alerts along with their connection | ||
verification status. | ||
jsonify: A JSON response containing a list of alerts. Each item in the list is a dictionary representing an alert, | ||
containing all its associated data. | ||
""" | ||
service = AlertsService() | ||
alerts = service.collect_alerts() | ||
return alerts | ||
return jsonify(alerts) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.