mirror of https://github.com/MISP/PyMISP
new: [usersStats] Possibility to fetch users/statistics data for all
context (usage, org, tags, ...)pull/257/head
parent
9669d892c5
commit
06b829e781
|
@ -1366,6 +1366,15 @@ class PyMISP(object):
|
|||
response = self._prepare_request('GET', url)
|
||||
return self._check_response(response)
|
||||
|
||||
def get_users_statistics(self, context='data'):
|
||||
"""Get users statistics from the MISP instance"""
|
||||
availables_contexts = ['data', 'orgs', 'users', 'tags', 'attributehistogram', 'sightings', 'attackMatrix']
|
||||
if context not in availables_contexts:
|
||||
context = 'data'
|
||||
url = urljoin(self.root_url, 'users/statistics/{}.json'.format(context))
|
||||
response = self._prepare_request('GET', url)
|
||||
return self._check_response(response)
|
||||
|
||||
# ############## Sightings ##################
|
||||
|
||||
def sighting_per_id(self, attribute_id):
|
||||
|
|
Loading…
Reference in New Issue