From 5c72dc9c33b4ae850d40ff06dfb05c27f3e80e5d Mon Sep 17 00:00:00 2001 From: DragonDev1906 Date: Thu, 6 Dec 2018 14:26:23 +0100 Subject: [PATCH] dded get_object & get_attribute --- pymisp/api.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/pymisp/api.py b/pymisp/api.py index 4e0f8a5..a59c99a 100644 --- a/pymisp/api.py +++ b/pymisp/api.py @@ -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