Merge branch 'master' of github.com:MISP/PyMISP

pull/271/head
Alexandre Dulaunoy 2018-08-28 20:47:15 +02:00
commit 9260723696
No known key found for this signature in database
GPG Key ID: 09E2CD4944E6CBCD
1 changed files with 19 additions and 0 deletions

View File

@ -1622,6 +1622,25 @@ class PyMISP(object):
response = self._prepare_request('POST', url, json.dumps(jdata))
return self._check_response(response)
def server_pull(self, server_id, event_id=None):
url = urljoin(self.root_url, 'servers/pull/{}'.format(server_id))
if event_id is not None:
url += '/{}'.format(event_id)
response = self._prepare_request('GET', url)
return self._check_response(response)
def server_push(self, server_id, event_id=None):
url = urljoin(self.root_url, 'servers/push/{}'.format(server_id))
if event_id is not None:
url += '/{}'.format(event_id)
response = self._prepare_request('GET', url)
return self._check_response(response)
def servers_index(self):
url = urljoin(self.root_url, 'servers/index')
response = self._prepare_request('GET', url)
return self._check_response(response)
# ############## Roles ##################
def get_roles_list(self):