@@ -91,7 +91,7 @@ def stop_all_jobs_in_experiment(experiment: str) -> ResponseReturnValue:
9191 """Kills all jobs for workers assigned to experiment"""
9292 workers_in_experiment = get_all_workers_in_experiment (experiment )
9393 tasks .multicast_post_across_cluster (
94- f"/unit_api/jobs/stop/experiment/ { experiment } " , workers_in_experiment
94+ f"/unit_api/jobs/stop" , workers_in_experiment , params = { 'experiment' : experiment }
9595 )
9696
9797 # sometimes the leader isn't part of the experiment, but a profile associated with the experiment is running:
@@ -109,10 +109,10 @@ def stop_all_jobs_on_worker_for_experiment(
109109) -> ResponseReturnValue :
110110 """Kills all jobs for worker assigned to experiment"""
111111 if pioreactor_unit == UNIVERSAL_IDENTIFIER :
112- broadcast_post_across_cluster (f"/unit_api/jobs/stop/experiment/ { experiment } " )
112+ broadcast_post_across_cluster (f"/unit_api/jobs/stop" , params = { ' experiment' : experiment } )
113113 else :
114114 tasks .multicast_post_across_cluster (
115- f"/unit_api/jobs/stop/experiment/ { experiment } " , [pioreactor_unit ]
115+ f"/unit_api/jobs/stop" , [pioreactor_unit ], params = { 'experiment' : experiment }
116116 )
117117
118118 return Response (status = 202 )
@@ -123,21 +123,21 @@ def stop_all_jobs_on_worker_for_experiment(
123123 methods = ["PATCH" , "POST" ],
124124)
125125@api .route (
126- "/units/<pioreactor_unit>/jobs/stop/job_name/<job >/experiments/<experiment>" ,
126+ "/units/<pioreactor_unit>/jobs/stop/job_name/<job_name >/experiments/<experiment>" ,
127127 methods = ["PATCH" , "POST" ],
128128)
129- def stop_job_on_unit (pioreactor_unit : str , experiment : str , job : str ) -> ResponseReturnValue :
129+ def stop_job_on_unit (pioreactor_unit : str , experiment : str , job_name : str ) -> ResponseReturnValue :
130130 """Kills specified job on unit"""
131131
132132 msg = client .publish (
133- f"pioreactor/{ pioreactor_unit } /{ experiment } /{ job } /$state/set" , b"disconnected" , qos = 1
133+ f"pioreactor/{ pioreactor_unit } /{ experiment } /{ job_name } /$state/set" , b"disconnected" , qos = 1
134134 )
135135 try :
136136 msg .wait_for_publish (timeout = 2.0 )
137137 except Exception :
138138 # TODO: make this $broadcastable
139139 tasks .multicast_post_across_cluster (
140- f"/unit_api/jobs/stop/job_name/ { job } " , [pioreactor_unit ]
140+ f"/unit_api/jobs/stop" , [pioreactor_unit ], params = { 'job_name' : job_name }
141141 )
142142 abort (500 )
143143
@@ -1261,7 +1261,7 @@ def create_experiment() -> ResponseReturnValue:
12611261@api .route ("/experiments/<experiment>" , methods = ["DELETE" ])
12621262def delete_experiment (experiment : str ) -> ResponseReturnValue :
12631263 row_count = modify_app_db ("DELETE FROM experiments WHERE experiment=?;" , (experiment ,))
1264- broadcast_post_across_cluster (f"/unit_api/jobs/stop/experiment/ { experiment } " )
1264+ broadcast_post_across_cluster (f"/unit_api/jobs/stop" , params = { " experiment" : experiment } )
12651265
12661266 if row_count > 0 :
12671267 return Response (status = 200 )
@@ -2089,7 +2089,7 @@ def remove_worker_from_experiment(experiment: str, pioreactor_unit: str) -> Resp
20892089 )
20902090 if row_count > 0 :
20912091 tasks .multicast_post_across_cluster (
2092- f"/unit_api/jobs/stop/experiment/ { experiment } " , [pioreactor_unit ]
2092+ f"/unit_api/jobs/stop" , [pioreactor_unit ], params = { 'experiment' : experiment }
20932093 )
20942094 publish_to_experiment_log (
20952095 f"Removed { pioreactor_unit } from { experiment } ." ,
@@ -2109,7 +2109,7 @@ def remove_workers_from_experiment(experiment: str) -> ResponseReturnValue:
21092109 "DELETE FROM experiment_worker_assignments WHERE experiment = ?" ,
21102110 (experiment ,),
21112111 )
2112- task = broadcast_post_across_cluster (f"/unit_api/jobs/stop/experiment/ { experiment } " )
2112+ task = broadcast_post_across_cluster (f"/unit_api/jobs/stop" , params = { ' experiment' : experiment } )
21132113 publish_to_experiment_log (
21142114 f"Removed all workers from { experiment } ." ,
21152115 experiment = experiment ,
0 commit comments