Class: Mihari::TheHive::Alert
Instance Method Summary collapse
- #create(title:, description:, artifacts:, tags: []) ⇒ Hash
- #list(range: "all", sort: "-date") ⇒ Array
Methods inherited from Base
Instance Method Details
#create(title:, description:, artifacts:, tags: []) ⇒ Hash
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/mihari/the_hive/alert.rb', line 13 def create(title:, description:, artifacts:, tags: []) api.alert.create( title: title, description: description, artifacts: artifacts, tags: , type: "external", source: "mihari" ) end |
#list(range: "all", sort: "-date") ⇒ Array
7 8 9 10 |
# File 'lib/mihari/the_hive/alert.rb', line 7 def list(range: "all", sort: "-date") alerts = api.alert.search({ source: "mihari" }, range: range, sort: sort) alerts.sort_by { |alert| -alert.dig("createdAt") } end |