Skip to content
This repository has been archived by the owner on Nov 2, 2024. It is now read-only.

Commit

Permalink
job_id BI (intelowlproject#2449)
Browse files Browse the repository at this point in the history
* added job_id field to bi

* removed name from JobBISerializer
  • Loading branch information
cristinaascari authored and vaclavbartos committed Oct 13, 2024
1 parent 9099bcd commit 9a28693
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions api_app/serializers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@ class AbstractBIInterface(BISerializer):
application = rfs.CharField(read_only=True, default="IntelOwl")
environment = rfs.SerializerMethodField(method_name="get_environment")
username: Field
name: Field
class_instance = rfs.SerializerMethodField(
read_only=True, method_name="get_class_instance"
)
process_time: Field
status: Field
end_time: Field
job_id: Field

class Meta:
fields = BISerializer.Meta.fields + [
"username",
"name",
"class_instance",
"process_time",
"status",
"end_time",
"job_id",
]

@staticmethod
Expand Down
2 changes: 1 addition & 1 deletion api_app/serializers/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -1092,9 +1092,9 @@ def create(self, validated_data):
class JobBISerializer(AbstractBIInterface, ModelSerializer):
timestamp = rfs.DateTimeField(source="received_request_time")
username = rfs.CharField(source="user.username")
name = rfs.CharField(source="pk")
end_time = rfs.DateTimeField(source="finished_analysis_time")
playbook = rfs.SerializerMethodField(source="get_playbook")
job_id = rfs.CharField(source="pk")

class Meta:
model = Job
Expand Down
2 changes: 2 additions & 0 deletions api_app/serializers/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ class AbstractReportBISerializer(AbstractBIInterface):
timestamp = rfs.DateTimeField(source="start_time")
username = rfs.CharField(source="job.user.username")
name = rfs.SlugRelatedField(read_only=True, source="config", slug_field="name")
job_id = rfs.CharField(source="job.pk")

class Meta:
fields = AbstractBIInterface.Meta.fields + [
"name",
"parameters",
]
list_serializer_class = rfs.ListSerializer
Expand Down
2 changes: 1 addition & 1 deletion requirements/certego-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
certego-saas==0.7.10
certego-saas==0.7.11
# While developing for certego-saas, comment the previous line.
# Then, add a line like the one below to your forked repo and your most recent commit
# In this way you can test your changes directly in IntelOwl with the complete application
Expand Down

0 comments on commit 9a28693

Please sign in to comment.