def delete_alert(self, aid): """Delete the alert with the given ID.""" func = '/shodan/alert/%s' % aid response = helpers.api_request(self.api_key, func, params={}, method='delete') return response
def alerts(self, aid=None, include_expired=True): """List all of the active alerts that the user created.""" if aid: func = '/shodan/alert/%s/info' % aid else: func = '/shodan/alert/info' response = helpers.api_request(self.api_key, func, params={ 'include_expired': include_expired, }) return response
def create_alert(self, name, ip, expires=0): """Search the directory of saved search queries in Shodan. :param query: The number of tags to return :type page: int :returns: A list of tags. """ data = { 'name': name, 'filters': { 'ip': ip, }, 'expires': expires, } response = helpers.api_request(self.api_key, '/shodan/alert', data=data, params={}, method='post') return response