Skip to content

Commit

Permalink
Initial Tags API
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafiot committed Dec 21, 2015
1 parent a7fc1ce commit f968f43
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions pymisp/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,21 @@ def download_suricata_rule_event(self, event_id):
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):
Expand Down

0 comments on commit f968f43

Please sign in to comment.