@@ -80,6 +80,22 @@ class ClearingStatus(Enum):
80
80
REJECTED = "Rejected"
81
81
82
82
83
+ class JobStatus (Enum ):
84
+ """Job statuses:
85
+
86
+ COMPLETED
87
+ FAILED
88
+ QUEUED
89
+ PROCESSING
90
+
91
+ """
92
+
93
+ COMPLETED = "Completed"
94
+ FAILED = "Failed"
95
+ QUEUED = "Queued"
96
+ PROCESSING = "Processing"
97
+
98
+
83
99
class LicenseType (Enum ):
84
100
"""License types:
85
101
@@ -793,6 +809,37 @@ def from_json(cls, json_dict):
793
809
return cls (** json_dict )
794
810
795
811
812
+ class FossologyServer (object ):
813
+
814
+ """FOSSology server info.
815
+
816
+ :param version: version of the FOSSology server (e.g. 4.0.0)
817
+ :param branchName: branch deployed on the FOSSology server
818
+ :param commitHash: hash of commit deployed on the FOSSology server
819
+ :param commitDate: date of commit deployed on the FOSSology server in ISO8601 format
820
+ :param buildDate: date on which packages were built in ISO8601 format
821
+ :type version: string
822
+ :type branchName: string
823
+ :type commitHash: string
824
+ :type commitDate: string
825
+ :type buildDate: string
826
+ """
827
+
828
+ def __init__ (self , version , branchName , commitHash , commitDate , buildDate ):
829
+ self .version = version
830
+ self .branchName = branchName
831
+ self .commitHash = commitHash
832
+ self .commitDate = commitDate
833
+ self .buildDate = buildDate
834
+
835
+ def __str__ (self ):
836
+ return f"Fossology server version { self .version } (branch { self .branchName } - { self .commitHash } )"
837
+
838
+ @classmethod
839
+ def from_json (cls , json_dict ):
840
+ return cls (** json_dict )
841
+
842
+
796
843
class ApiInfo (object ):
797
844
798
845
"""FOSSology API info.
@@ -805,28 +852,39 @@ class ApiInfo(object):
805
852
:param security: security methods allowed
806
853
:param contact: email contact from the API documentation
807
854
:param license: licensing of the API
855
+ :param fossology: information about FOSSology server
808
856
:type name: string
809
857
:type description: string
810
858
:type version: string
811
859
:type security: list
812
860
:type contact: string
813
861
:type license: ApiLicense object
862
+ :type fossology: FossologyServer object
814
863
:type kwargs: key word argument
815
864
"""
816
865
817
866
def __init__ (
818
- self , name , description , version , security , contact , license , ** kwargs
867
+ self ,
868
+ name ,
869
+ description ,
870
+ version ,
871
+ security ,
872
+ contact ,
873
+ license ,
874
+ fossology ,
875
+ ** kwargs ,
819
876
):
820
877
self .name = name
821
878
self .description = description
822
879
self .version = version
823
880
self .security = security
824
881
self .contact = contact
825
882
self .license = ApiLicense .from_json (license )
883
+ self .fossology = FossologyServer .from_json (fossology )
826
884
self .additional_info = kwargs
827
885
828
886
def __str__ (self ):
829
- return f"FOSSology API { self .name } is deployed with version { self .version } "
887
+ return f"{ self .name } is deployed with version { self .version } "
830
888
831
889
@classmethod
832
890
def from_json (cls , json_dict ):
0 commit comments