RabbitMQAdmin

RabbitMQAdmin module serves for the management of the internal RabbitMQ users database. It uses rabbitmqctl command. Only the user with the right permissions can execute those commands.

DIRAC.Core.Utilities.RabbitMQAdmin.addUser(user, password='password')

Adds user to the internal RabbitMQ database Function also sets user password. User still cannot access to any resources, without having permissions set.

DIRAC.Core.Utilities.RabbitMQAdmin.addUserWithoutPassword(user)

Adds user to the internal RabbitMQ database and clears its password. This should be done for all users, that will be using SSL authentication. They do not need any password.

DIRAC.Core.Utilities.RabbitMQAdmin.addUsers(users)

Adds users to the RabbitMQ internal database.

DIRAC.Core.Utilities.RabbitMQAdmin.addUsersWithoutPasswords(users)
DIRAC.Core.Utilities.RabbitMQAdmin.clearUserPassword(user)

Clears users password for the internal RabbitMQ database. User with no password cannot enter the RabbitMQ website interface but still can connect via SSL if given permission.

DIRAC.Core.Utilities.RabbitMQAdmin.deleteUser(user)

Removes the user from the internal RabbitMQ database.

DIRAC.Core.Utilities.RabbitMQAdmin.deleteUsers(users)

Deletes users from the RabbitMQ internal database.

DIRAC.Core.Utilities.RabbitMQAdmin.executeRabbitmqctl(arg, *argv)
Executes RabbitMQ administration command.

It uses rabbitmqctl command line interface. For every command the -q argument (“quit mode”) is used, since in some cases the output must be processed, so we don’t want any additional informations printed.

Parameters:
  • arg (str) – command recognized by the rabbitmqctl.

  • argv (list) – optional list of string parameters.

Return type:

S_OK or S_ERROR

DIRAC.Core.Utilities.RabbitMQAdmin.getAllUsers()

Returns all existing users in the internal RabbitMQ database.

Returns:

S_OK with a list of all users

Return type:

S_OK

DIRAC.Core.Utilities.RabbitMQAdmin.setUserPermission(user)
DIRAC.Core.Utilities.RabbitMQAdmin.setUsersPermissions(users)