:orphan:

:py:mod:`slidge.command.admin`
==============================

.. py:module:: slidge.command.admin


Module Contents
---------------

Classes
~~~~~~~

.. autoapisummary::

   slidge.command.admin.AdminCommand
   slidge.command.admin.ListUsers
   slidge.command.admin.SlidgeInfo
   slidge.command.admin.DeleteUser
   slidge.command.admin.ChangeLoglevel
   slidge.command.admin.Exec




.. py:class:: AdminCommand(xmpp)




   Abstract base class to implement gateway commands (chatbot and ad-hoc)

   .. py:attribute:: NAME
      :type: str

      Friendly name of the command, eg: "do something with stuff"


   .. py:attribute:: HELP
      :type: str

      Long description of what the command does


   .. py:attribute:: NODE
      :type: str

      Name of the node used for ad-hoc commands


   .. py:attribute:: CHAT_COMMAND
      :type: str

      Text to send to the gateway to trigger the command via a message


   .. py:method:: run(session, ifrom, *args)
      :async:

      Entry point of the command

      :param session: If triggered by a registered user, its slidge Session
      :param ifrom: JID of the command-triggering entity
      :param args: When triggered via chatbot type message, additional words
          after the CHAT_COMMAND string was passed

      :return: Either a TableResult, a Form, a Confirmation, a text, or None


   .. py:method:: raise_if_not_authorized(jid)

      Raise an appropriate error is jid is not authorized to use the command

      :param jid: jid of the entity trying to access the command
      :return:session of JID if it exists



.. py:class:: ListUsers(xmpp)




   Abstract base class to implement gateway commands (chatbot and ad-hoc)

   .. py:attribute:: NODE
      :type: str

      Name of the node used for ad-hoc commands


   .. py:attribute:: CHAT_COMMAND
      :type: str

      Text to send to the gateway to trigger the command via a message


   .. py:method:: run(_session, _ifrom, *_)
      :async:

      Entry point of the command

      :param session: If triggered by a registered user, its slidge Session
      :param ifrom: JID of the command-triggering entity
      :param args: When triggered via chatbot type message, additional words
          after the CHAT_COMMAND string was passed

      :return: Either a TableResult, a Form, a Confirmation, a text, or None


   .. py:method:: raise_if_not_authorized(jid)

      Raise an appropriate error is jid is not authorized to use the command

      :param jid: jid of the entity trying to access the command
      :return:session of JID if it exists



.. py:class:: SlidgeInfo(xmpp)




   Abstract base class to implement gateway commands (chatbot and ad-hoc)

   .. py:attribute:: NODE
      :type: str

      Name of the node used for ad-hoc commands


   .. py:attribute:: CHAT_COMMAND
      :type: str

      Text to send to the gateway to trigger the command via a message


   .. py:method:: run(_session, _ifrom, *_)
      :async:

      Entry point of the command

      :param session: If triggered by a registered user, its slidge Session
      :param ifrom: JID of the command-triggering entity
      :param args: When triggered via chatbot type message, additional words
          after the CHAT_COMMAND string was passed

      :return: Either a TableResult, a Form, a Confirmation, a text, or None


   .. py:method:: raise_if_not_authorized(jid)

      Raise an appropriate error is jid is not authorized to use the command

      :param jid: jid of the entity trying to access the command
      :return:session of JID if it exists



.. py:class:: DeleteUser(xmpp)




   Abstract base class to implement gateway commands (chatbot and ad-hoc)

   .. py:attribute:: NODE
      :type: str

      Name of the node used for ad-hoc commands


   .. py:attribute:: CHAT_COMMAND
      :type: str

      Text to send to the gateway to trigger the command via a message


   .. py:method:: run(_session, _ifrom, *_)
      :async:

      Entry point of the command

      :param session: If triggered by a registered user, its slidge Session
      :param ifrom: JID of the command-triggering entity
      :param args: When triggered via chatbot type message, additional words
          after the CHAT_COMMAND string was passed

      :return: Either a TableResult, a Form, a Confirmation, a text, or None


   .. py:method:: raise_if_not_authorized(jid)

      Raise an appropriate error is jid is not authorized to use the command

      :param jid: jid of the entity trying to access the command
      :return:session of JID if it exists



.. py:class:: ChangeLoglevel(xmpp)




   Abstract base class to implement gateway commands (chatbot and ad-hoc)

   .. py:attribute:: NODE
      :type: str

      Name of the node used for ad-hoc commands


   .. py:attribute:: CHAT_COMMAND
      :type: str

      Text to send to the gateway to trigger the command via a message


   .. py:method:: run(_session, _ifrom, *_)
      :async:

      Entry point of the command

      :param session: If triggered by a registered user, its slidge Session
      :param ifrom: JID of the command-triggering entity
      :param args: When triggered via chatbot type message, additional words
          after the CHAT_COMMAND string was passed

      :return: Either a TableResult, a Form, a Confirmation, a text, or None


   .. py:method:: raise_if_not_authorized(jid)

      Raise an appropriate error is jid is not authorized to use the command

      :param jid: jid of the entity trying to access the command
      :return:session of JID if it exists



.. py:class:: Exec(xmpp)




   Abstract base class to implement gateway commands (chatbot and ad-hoc)

   .. py:attribute:: NAME
      :type: str

      Friendly name of the command, eg: "do something with stuff"


   .. py:attribute:: HELP
      :type: str

      Long description of what the command does


   .. py:method:: run(session, ifrom, *args)
      :async:

      Entry point of the command

      :param session: If triggered by a registered user, its slidge Session
      :param ifrom: JID of the command-triggering entity
      :param args: When triggered via chatbot type message, additional words
          after the CHAT_COMMAND string was passed

      :return: Either a TableResult, a Form, a Confirmation, a text, or None


   .. py:method:: raise_if_not_authorized(jid)

      Raise an appropriate error is jid is not authorized to use the command

      :param jid: jid of the entity trying to access the command
      :return:session of JID if it exists



