jscheffl commented on code in PR #55625:
URL: https://github.com/apache/airflow/pull/55625#discussion_r2346502905


##########
providers/edge3/src/airflow/providers/edge3/worker_api/routes/ui.py:
##########
@@ -208,3 +243,51 @@ def delete_worker(
         remove_worker(worker_name, session=session)
     except Exception as e:
         raise HTTPException(status.HTTP_400_BAD_REQUEST, detail=str(e))
+
+
+@ui_router.post(
+    "/worker/{worker_name}/queues/add",
+    dependencies=[
+        Depends(requires_access_view(access_view=AccessView.JOBS)),
+    ],
+)
+def add_worker_queue(
+    worker_name: str,
+    queue_request: QueueUpdateRequest,
+    session: SessionDep,
+) -> None:
+    """Add a queue to a worker."""
+    # Check if worker exists first
+    worker_query = select(EdgeWorkerModel).where(EdgeWorkerModel.worker_name 
== worker_name)
+    worker = session.scalar(worker_query)
+    if not worker:
+        raise HTTPException(status.HTTP_404_NOT_FOUND, detail=f"Worker 
{worker_name} not found")
+
+    try:
+        add_worker_queues(worker_name, [queue_request.queue_name], 
session=session)
+    except Exception as e:
+        raise HTTPException(status.HTTP_400_BAD_REQUEST, detail=str(e))
+
+
+@ui_router.post(
+    "/worker/{worker_name}/queues/remove",

Review Comment:
   Same here.
   ```suggestion
   @ui_router.delete(
       "/worker/{worker_name}/queues",
   ```



-- 
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