dded get_object & get_attribute

pull/310/head
DragonDev1906 2018-12-06 14:26:23 +01:00
parent a4273f5452
commit 5c72dc9c33
1 changed files with 18 additions and 0 deletions

View File

@ -336,6 +336,24 @@ class PyMISP(object):
response = self._prepare_request('GET', url)
return self._check_response(response)
def get_object(self, obj_id):
"""Get an object
:param obj_id: Object id to get
"""
url = urljoin(self.root_url, 'objects/view/{}'.format(obj_id))
response = self._prepare_request('GET', url)
return self._check_response(response)
def get_attribute(self, att_id):
"""Get an attribute
:param att_id: Attribute id to get
"""
url = urljoin(self.root_url, 'attributes/view/{}'.format(att_id))
response = self._prepare_request('GET', url)
return self._check_response(response)
def add_event(self, event):
"""Add a new event