Merge pull request #18 from Delta-Sierra/master

add function get_sharing_groups
pull/21/head
Alexandre Dulaunoy 2016-05-19 14:29:45 +02:00
commit 6fc403f7c8
1 changed files with 9 additions and 0 deletions

View File

@ -1019,6 +1019,15 @@ class PyMISP(object):
url = urljoin(self.root_url, 'sightings/add/') url = urljoin(self.root_url, 'sightings/add/')
return session.post(url, data=json.dumps(jdata)) return session.post(url, data=json.dumps(jdata))
# ############## Sharing Groups ##################
def get_sharing_groups(self):
session = self.__prepare_session(force_out=None)
url = urljoin(self.root_url, 'sharing_groups/index.json')
response = session.get(url)
return self._check_response(response)['response'][0]
# ############## Deprecated (Pure XML API should not be used) ################## # ############## Deprecated (Pure XML API should not be used) ##################
@deprecated @deprecated
def download_all(self): def download_all(self):