예제 #1
0
 def read_all_filters(self):
     """
     @return a list of filters creates.
     """
     result = ExternalApiFilterRequest(
         ExternalApiFilterRequest.READ_REQUEST, None, 0, None)
     return self.post(
         url_path=self.API_FILTERS_URL,
         body_params=result.get_json_encode_for_filter_based_requests(),
     )
예제 #2
0
 def read_group_filters(self):
     """
     @return all group filters created
     """
     result = ExternalApiFilterRequest(ExternalApiFilterRequest.READ_GROUPS,
                                       None, 0, None)
     return self.post(
         url_path=self.API_FILTERS_URL,
         body_params=result.get_json_encode_for_filter_based_requests(),
     )
예제 #3
0
 def update_filter(self, filter):
     """
     This method update changes associates with a filter.
     @param $filter Filter structure.
     """
     result = ExternalApiFilterRequest(
         ExternalApiFilterRequest.UPDATE_REQUEST, filter, 0, None)
     return self.post(
         url_path=self.API_FILTERS_URL,
         body_params=result.get_json_encode_for_filter_based_requests(),
     )
예제 #4
0
 def get_group_RSS_info(self, groupName):
     """
     This method get the RSS information of a filters group.
     @param $groupName name of the filters group you want get RSS information.
     """
     result = ExternalApiFilterRequest(
         ExternalApiFilterRequest.GET_GROUP_RSS, None, None, groupName)
     return self.post(
         url_path=self.API_FILTERS_URL,
         body_params=result.
         get_json_encode_dict_filter_for_content_based_requests(),
     )
예제 #5
0
 def get_RSS_info(self, filter_id):
     """
     This method get the RSS information of a filter.
     @param $filter_id id to filter you want get RSS information.
     """
     result = ExternalApiFilterRequest(
         ExternalApiFilterRequest.GET_RSS_REQUEST, None, None, filter_id)
     return self.post(
         url_path=self.API_FILTERS_URL,
         body_params=result.
         get_json_encode_dict_filter_for_content_based_requests(),
     )
예제 #6
0
 def subscribe_public_filter(self, filter_id):
     """
     With this method you can unsubscribe to filter.
     @param $filter_id id to filter you want unsubscribe.
     """
     result = ExternalApiFilterRequest(
         ExternalApiFilterRequest.SUBSCRIBE_REQUEST, None, 0, filter_id)
     return self.post(
         url_path=self.API_FILTERS_URL,
         body_params=result.
         get_json_encode_dict_filter_for_content_based_requests(),
     )
예제 #7
0
 def delete_filter(self, filter_id):
     """
  	This method delete a filter create.
     @param $filter_id id of the filter you want to delete.
     """
     filter = Filter(filter_id)
     result = ExternalApiFilterRequest(
         ExternalApiFilterRequest.DELETE_REQUEST, filter, 0, None)
     return self.post(
         url_path=self.API_FILTERS_URL,
         body_params=result.get_json_encode_for_filter_based_requests(),
     )
예제 #8
0
 def read_one_filter(self, filter_id):
     """
     @param $filter_id id of the filter you want to read.
     @return This method returns the details of filter associate with this filter_id.
     """
     filter = Filter(filter_id)
     result = ExternalApiFilterRequest(
         ExternalApiFilterRequest.READ_REQUEST, filter, 0, None)
     return self.post(
         url_path=self.API_FILTERS_URL,
         body_params=result.get_json_encode_for_filter_based_requests(),
     )
예제 #9
0
 def list_detected_apps(self, page, filter_id):
     """
     @param $filter_id id to the filter.
     @return Json structure with the details of applications detected by the filter.
     """
     result = ExternalApiFilterRequest(
         ExternalApiFilterRequest.LIST_DETECTIONS_REQUEST, None, page,
         filter_id)
     return self.post(
         url_path=self.API_FILTERS_URL,
         body_params=result.
         get_json_encode_dict_filter_for_content_based_requests(),
     )
예제 #10
0
 def list_group_detected_apps(self, page, groupName):
     """
     @param $groupName name of the group.
     @param $page A number greater or equal to 1 indicating the page of results which have to be retrieved.
     @return Json structure with the details of applications detected by the filters group.
     """
     result = ExternalApiFilterRequest(
         ExternalApiFilterRequest.LIST_GROUP_DETECTIONS, None, page,
         groupName)
     return self.post(
         url_path=self.API_FILTERS_URL,
         body_params=result.
         get_json_encode_dict_filter_for_content_based_requests(),
     )
예제 #11
0
 def search_public_filter(self, query, page):
     """
     @param $query any word or phrase within the description or title Filter
     @param $page A number greater or equal to 1 indicating the page of results which have to be retrieved.
     @return A list of public filters(Visibility = Public)
     """
     result = ExternalApiFilterRequest(
         ExternalApiFilterRequest.SEARCH_PUBLIC_FILTER_REQUEST, None, page,
         query)
     return self.post(
         url_path=self.API_FILTERS_URL,
         body_params=result.
         get_json_encode_dict_filter_for_content_based_requests(),
     )