forked from TheHive-Project/TheHive4py
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding ability to search for templates, see TheHive-Project#83
- Loading branch information
1 parent
be80a7d
commit 021c855
Showing
3 changed files
with
36 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
from __future__ import print_function | ||
from __future__ import unicode_literals | ||
|
||
import sys | ||
import json | ||
from thehive4py.api import TheHiveApi | ||
from thehive4py.models import CaseTemplate | ||
from thehive4py.exceptions import CaseTemplateException | ||
from thehive4py.query import * | ||
|
||
api = TheHiveApi('http://127.0.0.1:9000', 'JC7wGXWHi0XhvepKK1fBnP67d6JRjx0r') | ||
|
||
print('Search for case templates') | ||
print('-----------------------------') | ||
|
||
response = api.find_case_templates(query=Eq("status", "Ok")) | ||
|
||
if response.status_code == 200: | ||
print(json.dumps(response.json(), indent=4, sort_keys=True)) | ||
print('') | ||
|
||
else: | ||
print('ko: {}/{}'.format(response.status_code, response.text)) | ||
sys.exit(0) |
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