PyMISP/examples/del.py

23 lines
661 B
Python
Raw Normal View History

2016-08-18 00:40:30 +02:00
#!/usr/bin/env python
# -*- coding: utf-8 -*-
2019-07-17 16:46:47 +02:00
from pymisp import ExpandedPyMISP
from keys import misp_url, misp_key, misp_verifycert
2016-08-18 00:40:30 +02:00
import argparse
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Delete an event from a MISP instance.')
parser.add_argument("-e", "--event", help="Event ID to delete.")
parser.add_argument("-a", "--attribute", help="Attribute ID to delete.")
args = parser.parse_args()
2019-07-17 16:46:47 +02:00
misp = ExpandedPyMISP(misp_url, misp_key, misp_verifycert)
2016-08-18 00:40:30 +02:00
if args.event:
2019-07-17 16:46:47 +02:00
result = misp.delete_event(args.event)
2016-08-18 00:40:30 +02:00
else:
2019-07-17 16:46:47 +02:00
result = misp.delete_attribute(args.attribute)
print(result)