Initial Tags API

pull/3/head
Raphaël Vinot 2015-12-21 18:58:08 +01:00
parent a7fc1ceb20
commit f968f43bd9
1 changed files with 15 additions and 0 deletions

View File

@ -804,6 +804,21 @@ class PyMISP(object):
session = self.__prepare_session('rules')
return session.get(template)
# ########## Tags ##########
def get_all_tags(self, quiet=False):
session = self.__prepare_session('json')
url = urljoin(self.root_url, 'tags')
response = session.get(url)
r = self._check_response(response)
if not quiet or r.get('errors'):
return r
else:
to_return = []
for tag in r['Tag']:
to_return.append(tag['name'])
return to_return
# ########## Version ##########
def get_api_version(self):