MCPcopy Create free account
hub / github.com/intelowlproject/IntelOwl / get_object

Method get_object

api_app/views.py:1018–1044  ·  view source on GitHub ↗

Retrieves a specific report object by job_id and report_id. Overrides the drf's default `get_object` method to fetch a report object based on job_id and report_id, and checks the permissions for the object. Args: job_id (int): The ID of the job associat

(self, job_id: int, report_id: int)

Source from the content-addressed store, hash-verified

1016 return self.report_model.objects.all()
1017
1018 def get_object(self, job_id: int, report_id: int) -> AbstractReport:
1019 """
1020 Retrieves a specific report object by job_id and report_id.
1021
1022 Overrides the drf's default `get_object` method to fetch a report object
1023 based on job_id and report_id, and checks the permissions for the object.
1024
1025 Args:
1026 job_id (int): The ID of the job associated with the report.
1027 report_id (int): The ID of the report.
1028
1029 Returns:
1030 AbstractReport: The report object.
1031
1032 Raises:
1033 NotFound: If the report does not exist.
1034 """
1035 try:
1036 obj = self.report_model.objects.get(
1037 job_id=job_id,
1038 pk=report_id,
1039 )
1040 except self.report_model.DoesNotExist:
1041 raise NotFound()
1042 else:
1043 self.check_object_permissions(self.request, obj)
1044 return obj
1045
1046 @staticmethod
1047 def perform_kill(report: AbstractReport):

Callers 11

killMethod · 0.95
retryMethod · 0.95
retryMethod · 0.45
rescanMethod · 0.45
killMethod · 0.45
download_sampleMethod · 0.45
pivotMethod · 0.45
disable_in_orgMethod · 0.45
enable_in_orgMethod · 0.45
health_checkMethod · 0.45
pullMethod · 0.45

Calls 2

getMethod · 0.45

Tested by

no test coverage detected