From 9829f054e35aa08d1b5ebe48f7348a5894dbaa86 Mon Sep 17 00:00:00 2001 From: mher <691049+mher@users.noreply.github.com> Date: Fri, 1 Jul 2022 13:20:20 -0400 Subject: [PATCH] Diable API if auth is enabled (#1225) * Disable api calls if auth is configured * Remove leftover code * Depricate WebSocket API --- README.rst | 10 +--------- examples/event-api.html | 20 ------------------- flower/api/__init__.py | 30 ++++++----------------------- flower/api/control.py | 4 ++-- flower/api/events.py | 35 ---------------------------------- flower/api/tasks.py | 4 ++-- flower/events.py | 5 ----- flower/urls.py | 10 ---------- tests/unit/api/test_control.py | 12 +++++++++++- tests/unit/api/test_events.py | 0 10 files changed, 22 insertions(+), 108 deletions(-) delete mode 100644 examples/event-api.html delete mode 100644 flower/api/events.py delete mode 100644 tests/unit/api/test_events.py diff --git a/README.rst b/README.rst index 03c3a32d3..ec323b5e3 100644 --- a/README.rst +++ b/README.rst @@ -104,8 +104,7 @@ Celery command and before Flower sub-command): :: API --- -Flower API enables to manage the cluster via REST API, call tasks and -receive task events in real-time via WebSockets. +Flower API enables to manage the cluster via REST API. For example you can restart worker's pool by: :: @@ -119,13 +118,6 @@ Or terminate executing task by: :: $ curl -X POST -d 'terminate=True' http://localhost:5555/api/task/revoke/8a4da87b-e12b-4547-b89a-e92e4d1f8efd -Or receive task completion events in real-time: :: - - var ws = new WebSocket("ws://localhost:5555/api/task/events/task-succeeded/"); - ws.onmessage = function (event) { - console.log(event.data); - } - For more info checkout `API Reference`_ and `examples`_. .. _API Reference: https://flower.readthedocs.io/en/latest/api.html diff --git a/examples/event-api.html b/examples/event-api.html deleted file mode 100644 index 45225bba2..000000000 --- a/examples/event-api.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - -
This example shows how to get task events
- -