@@ -42,6 +42,51 @@ def get_pipeline(self, pipeline_id:str):
4242 except Exception as e :
4343 print (f"Pipeline fetching failed. Exception - { e } " )
4444
45+ def get_pipelines (self ):
46+ url = f"{ self .endpoint } /pipelines/"
47+
48+ headers = {
49+ "accept" : "application/json" ,
50+ "neum-api-key" : self .api_key ,
51+ "content-type" : "application/json"
52+ }
53+
54+ try :
55+ response = requests .get (url , headers = headers )
56+ return json .loads (response .text )
57+ except Exception as e :
58+ print (f"Pipeline fetch failed. Exception - { e } " )
59+
60+ def get_pipeline_runs (self , pipeline_id :str ):
61+ url = f"{ self .endpoint } /pipelines/{ pipeline_id } /runs"
62+
63+ headers = {
64+ "accept" : "application/json" ,
65+ "neum-api-key" : self .api_key ,
66+ "content-type" : "application/json"
67+ }
68+
69+ try :
70+ response = requests .get (url , headers = headers )
71+ return json .loads (response .text )
72+ except Exception as e :
73+ print (f"Pipeline runs fetch failed. Exception - { e } " )
74+
75+ def get_pipeline_run (self , pipeline_id :str , pipeline_run_id :str ):
76+ url = f"{ self .endpoint } /pipelines/{ pipeline_id } /runs{ pipeline_run_id } "
77+
78+ headers = {
79+ "accept" : "application/json" ,
80+ "neum-api-key" : self .api_key ,
81+ "content-type" : "application/json"
82+ }
83+
84+ try :
85+ response = requests .get (url , headers = headers )
86+ return json .loads (response .text )
87+ except Exception as e :
88+ print (f"Pipeline run fetch failed. Exception - { e } " )
89+
4590 def trigger_pipeline (self , pipeline_id :str , sync_type :TriggerSyncTypeEnum ):
4691 url = f"{ self .endpoint } /pipelines/{ pipeline_id } /trigger"
4792
@@ -75,7 +120,7 @@ def search_pipeline(self, pipeline_id:str, query:str, num_of_results:int = 3, tr
75120 response = requests .post (url , json = payload , headers = headers )
76121 return json .loads (response .text )
77122 except Exception as e :
78- print (f"Pipeline trigger failed. Exception - { e } " )
123+ print (f"Pipeline search failed. Exception - { e } " )
79124
80125 def search_file (self , pipeline_id :str , file_id :str , query :str , num_of_results :int = 3 , track :bool = False , requested_by :str = None ):
81126 url = f"{ self .endpoint } /pipelines/{ pipeline_id } /files/search?file_id={ file_id } "
@@ -95,7 +140,7 @@ def search_file(self, pipeline_id:str, file_id:str, query:str, num_of_results:in
95140 response = requests .post (url , json = payload , headers = headers )
96141 return json .loads (response .text )
97142 except Exception as e :
98- print (f"Pipeline trigger failed. Exception - { e } " )
143+ print (f"File search failed. Exception - { e } " )
99144
100145 def get_files (self , pipeline_id :str ):
101146 url = f"{ self .endpoint } /pipelines/{ pipeline_id } /files"
@@ -110,7 +155,7 @@ def get_files(self, pipeline_id:str):
110155 response = requests .get (url , headers = headers )
111156 return json .loads (response .text )
112157 except Exception as e :
113- print (f"Pipeline trigger failed. Exception - { e } " )
158+ print (f"Files fetch failed. Exception - { e } " )
114159
115160 def get_file (self , pipeline_id :str , file_id :str ):
116161 url = f"{ self .endpoint } /pipelines/{ pipeline_id } /files?file_id={ file_id } "
@@ -125,7 +170,7 @@ def get_file(self, pipeline_id:str, file_id:str):
125170 response = requests .get (url , headers = headers )
126171 return json .loads (response .text )
127172 except Exception as e :
128- print (f"Pipeline trigger failed. Exception - { e } " )
173+ print (f"File fetch failed. Exception - { e } " )
129174
130175 def get_retrievals_by_file_id (self , pipeline_id :str , file_id :str ):
131176 url = f"{ self .endpoint } /retrievals/{ pipeline_id } /files?file_id={ file_id } "
@@ -140,7 +185,7 @@ def get_retrievals_by_file_id(self, pipeline_id:str, file_id:str):
140185 response = requests .get (url , headers = headers )
141186 return json .loads (response .text )
142187 except Exception as e :
143- print (f"Pipeline trigger failed. Exception - { e } " )
188+ print (f"Retrievals fetch failed. Exception - { e } " )
144189
145190 def get_retrievals_by_pipeline_id (self , pipeline_id :str ):
146191 url = f"{ self .endpoint } /retrievals/{ pipeline_id } "
@@ -155,7 +200,7 @@ def get_retrievals_by_pipeline_id(self, pipeline_id:str):
155200 response = requests .get (url , headers = headers )
156201 return json .loads (response .text )
157202 except Exception as e :
158- print (f"Pipeline trigger failed. Exception - { e } " )
203+ print (f"Retrievals fetch failed. Exception - { e } " )
159204
160205 def provide_retrieval_feedback (self , pipeline_id :str , retrieval_id :str , status :str ):
161206 url = f"{ self .endpoint } /retrievals/{ pipeline_id } /{ retrieval_id } "
@@ -173,4 +218,4 @@ def provide_retrieval_feedback(self, pipeline_id:str, retrieval_id:str, status:s
173218 response = requests .post (url , json = payload , headers = headers )
174219 return json .loads (response .text )
175220 except Exception as e :
176- print (f"Pipeline trigger failed. Exception - { e } " )
221+ print (f"Retrieval feedback failed. Exception - { e } " )
0 commit comments