How to use the brewtils.decorators.command function in brewtils

To help you get started, we’ve selected a few brewtils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github beer-garden / beer-garden / plugins / dynamic / main.py View on Github external
    @command
    def _get_attribute(self, attribute):
        return getattr(self, attribute)
github beer-garden / beer-garden / plugins / echo / echo / client.py View on Github external
    @command(output_type='JSON')
    @parameter(key="message", description="The Message to be Echoed", optional=True, type="String",
               default='{"str": "value", "nums": [1, 2, 17], "obj": {"nested": "awesome"}}')
    def say_json(self, message=DEFAULT_MESSAGE):
        """Echos with JSON output_type"""

        return message
github beer-garden / beer-garden / plugins / complex / complex / client.py View on Github external
    @command(command_type="INFO")
    @parameter(key="message", type="String", optional=False, nullable=False)
    def echo_message_info(self, message):
        if message is None:
            raise ValueError("Message cannot be None.")

        self.logger.info(message)
        return message
github beer-garden / beer-garden / plugins / custom-display / main.py View on Github external
    @command(form='./resources/say_form.json')
    @parameter(key="message", type="String", optional=False, nullable=False)
    @parameter(key="loud", type="Boolean")
    def echo_message_custom_form_from_file(self, message='Hello world!', loud=False):
        """form='./resources/say_form.json'"""
        return message + '!!!!!!!!!' if loud else message
github beer-garden / beer-garden / plugins / custom-display / main.py View on Github external
    @command(form={"type": "fieldset", "items": [{"key": "parameters.message", "readonly": True}]})
    @parameter(key="message", type="String", optional=False, nullable=False)
    def echo_message_custom_form_as_dict(self, message="Can't change me! Hahaha!"):
        """form={"type": "fieldset", "items": [{"key": "parameters.message", "readonly": True}]}"""
        return message
github beer-garden / beer-garden / plugins / complex / complex / client.py View on Github external
    @command(output_type="JSON")
    def echo_message_huge_json(self):
        d = {n: True for n in range(2000)}
        return json.dumps(d)
github beer-garden / beer-garden / plugins / complex / complex / client.py View on Github external
    @command
    def prove_env(self):
        """Prints out the DB_NAME and DB_PASS from the environment, just to prove it works"""
        self.logger.info("Proving the Environment Variables are there.")
        self.logger.info("DB Name    : %s" % os.getenv('DB_NAME'))
        self.logger.info("DB Password: %s" % os.getenv('DB_PASS'))
        self.logger.info("Told you they were here!")
        return json.dumps({'DB_NAME': os.getenv('DB_NAME'), 'DB_PASS': os.getenv('DB_PASS')})
github beer-garden / beer-garden / plugins / dynamic / main.py View on Github external
    @command(command_type='INFO', output_type="JSON")
    def get_choices_renamed(self):
        return self.STATIC_CHOICES_RENAMED
github beer-garden / beer-garden / plugins / custom-display / main.py View on Github external
    @command(template='./resources/minimalist.html')
    def echo_minimalist(self, message):
        return message
github beer-garden / beer-garden / plugins / dynamic / main.py View on Github external
    @command
    def get_choices_dictionary(self):
        return self.STATIC_CHOICES_DICTIONARY