mirror of https://github.com/MISP/PyMISP
commit
c2ef188e37
|
@ -375,12 +375,16 @@ class PyMISP(object):
|
||||||
return self.add_event(json.dumps(misp_event, cls=EncodeUpdate))
|
return self.add_event(json.dumps(misp_event, cls=EncodeUpdate))
|
||||||
|
|
||||||
def tag(self, uuid, tag):
|
def tag(self, uuid, tag):
|
||||||
|
if not self._valid_uuid(uuid):
|
||||||
|
raise PyMISPError('Invalid UUID')
|
||||||
session = self.__prepare_session()
|
session = self.__prepare_session()
|
||||||
path = '/tags/attachTagToObject/{}/{}/'.format(uuid, tag)
|
path = '/tags/attachTagToObject/{}/{}/'.format(uuid, tag)
|
||||||
response = session.post(urljoin(self.root_url, path))
|
response = session.post(urljoin(self.root_url, path))
|
||||||
return self._check_response(response)
|
return self._check_response(response)
|
||||||
|
|
||||||
def untag(self, uuid, tag):
|
def untag(self, uuid, tag):
|
||||||
|
if not self._valid_uuid(uuid):
|
||||||
|
raise PyMISPError('Invalid UUID')
|
||||||
session = self.__prepare_session()
|
session = self.__prepare_session()
|
||||||
path = '/tags/removeTagFromObject/{}/{}/'.format(uuid, tag)
|
path = '/tags/removeTagFromObject/{}/{}/'.format(uuid, tag)
|
||||||
response = session.post(urljoin(self.root_url, path))
|
response = session.post(urljoin(self.root_url, path))
|
||||||
|
|
Loading…
Reference in New Issue