chirodip98 commented on code in PR #61290:
URL: https://github.com/apache/airflow/pull/61290#discussion_r2751801828


##########
providers/google/src/airflow/providers/google/cloud/hooks/datafusion.py:
##########
@@ -532,23 +532,32 @@ def stop_pipeline(
         instance_url: str,
         namespace: str = "default",
         pipeline_type: DataFusionPipelineType = DataFusionPipelineType.BATCH,
+        run_id: str | None = None,
     ) -> None:
         """
         Stop a Cloud Data Fusion pipeline. Works for both batch and stream 
pipelines.
 
         :param pipeline_name: Your pipeline name.
         :param instance_url: Endpoint on which the REST APIs is accessible for 
the instance.
-        :param namespace: f your pipeline belongs to a Basic edition instance, 
the namespace ID
+        :param pipeline_type: Can be either BATCH or STREAM.
+        :param run_id: The specific run_id to stop execution if available; 
when absent it will stop all runs under pipeline_name.
+        :param namespace: If your pipeline belongs to a Basic edition 
instance, the namespace ID
             is always default. If your pipeline belongs to an Enterprise 
edition instance, you
             can create a namespace.
         """
-        url = os.path.join(
+        base_stop_url = os.path.join(
             self._base_url(instance_url, namespace),
             quote(pipeline_name),
             self.cdap_program_type(pipeline_type=pipeline_type),
             self.cdap_program_id(pipeline_type=pipeline_type),
-            "stop",
         )
+
+        if run_id:
+            url = os.path.join(base_stop_url, "runs", quote(str(run_id)), 
"stop")
+

Review Comment:
   Done



##########
providers/google/src/airflow/providers/google/cloud/hooks/datafusion.py:
##########
@@ -532,23 +532,32 @@ def stop_pipeline(
         instance_url: str,
         namespace: str = "default",
         pipeline_type: DataFusionPipelineType = DataFusionPipelineType.BATCH,
+        run_id: str | None = None,
     ) -> None:
         """
         Stop a Cloud Data Fusion pipeline. Works for both batch and stream 
pipelines.
 
         :param pipeline_name: Your pipeline name.
         :param instance_url: Endpoint on which the REST APIs is accessible for 
the instance.
-        :param namespace: f your pipeline belongs to a Basic edition instance, 
the namespace ID
+        :param pipeline_type: Can be either BATCH or STREAM.
+        :param run_id: The specific run_id to stop execution if available; 
when absent it will stop all runs under pipeline_name.
+        :param namespace: If your pipeline belongs to a Basic edition 
instance, the namespace ID

Review Comment:
   Done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to