From 8ca10435ffb00b3187dcc475903a730157e6edb0 Mon Sep 17 00:00:00 2001 From: Bo-Chun Louis Chen <louistw@uab.edu> Date: Thu, 14 Mar 2024 16:23:25 -0500 Subject: [PATCH] Add docstring for group member agent --- prod_rmq_agents/group_member.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/prod_rmq_agents/group_member.py b/prod_rmq_agents/group_member.py index afb786f..ae7e1f2 100644 --- a/prod_rmq_agents/group_member.py +++ b/prod_rmq_agents/group_member.py @@ -43,6 +43,25 @@ def insert_db(operation, groupname, msg): def group_member(ch, method, properties, body): + """ + Properties: + correlation_id (str): The UUID for the request. + reply_to (str): The RabbitMQ queue name for reply to send to. + + Message(body): + username (str): The user to be added/removed from groups. + groups (dict): A dictionary with `add` or `remove` key. + add (list): A list of groups to be added for the user. + remove (list): A list of groups to be removed for the user. + executed_by (str): The user who request the change. + host (str): Hostname where the request comes from. + interface (str): whether it's from CLI or WebUI. + + Returns: + status (bool): Whether or not the operation executed successfully. + errmsg (str): Detailed error message if operation failed. + task (str): The task name of the agent who handle the message. + """ msg = json.loads(body) username = msg["username"] msg["task"] = task -- GitLab