Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Communications Backbone System
communications-backbone
Commits
0f5e168c
Unverified
Commit
0f5e168c
authored
2 years ago
by
Dan Jones
Browse files
Options
Download
Email Patches
Plain Diff
fix: return list of queues with properties
Plus properly implement auth handler
parent
f0a6a868
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
endpoints/queues.py
endpoints/queues.py
+15
-4
No files found.
endpoints/queues.py
View file @
0f5e168c
...
...
@@ -6,16 +6,27 @@ from rmq import get_queue_status
class
QueueList
(
AuthResource
):
def
__init__
(
self
):
super
().
__init__
()
self
.
clients_file
=
ClientModel
()
def
get
(
self
):
allow
=
self
.
auth
(
request
)
if
allow
:
return
{
queue_status
=
{
client_id
:
{
"inbox"
:
get_queue_status
(
f
"
{
client_id
}
-inbox"
)
[
"size"
]
,
"outbox"
:
get_queue_status
(
f
"
{
client_id
}
-outbox"
)
[
"size"
]
,
"broadcast"
:
get_queue_status
(
f
"
{
client_id
}
-broadcast"
)
[
"size"
]
,
"inbox"
:
get_queue_status
(
f
"
{
client_id
}
-inbox"
),
"outbox"
:
get_queue_status
(
f
"
{
client_id
}
-outbox"
),
"broadcast"
:
get_queue_status
(
f
"
{
client_id
}
-broadcast"
),
}
for
client_id
in
self
.
clients_file
.
get
().
keys
()
}
return
[
{
"client_id"
:
client_id
,
"queue"
:
f
"
{
client_id
}
-
{
queue_type
}
"
,
"type"
:
queue_type
,
"properties"
:
queue_size
,
}
for
client_id
,
client_queues
in
queue_status
.
items
()
for
queue_type
,
queue_size
in
client_queues
.
items
()
]
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment