OB2 Logo

Opsbeacon

How to use arguments in commands and workflows

Overview

Arguments in commands allow you to customize and control the execution of commands within OpsBeacon platform. By using dynamic parameters, you can adapt your workflows to different scenarios based on user input. This document explains how to define and use these arguments effectively.


Defining Arguments

Arguments are defined within the command structure and are noted by curly braces {{ and }}. These placeholders will be replaced with actual values provided by the user at runtime. This allows the command to dynamically adapt based on input, making your commands flexible and powerful.

Syntax

To define an argument in a command, encapsulate the argument name within double curly braces. For example:

{{ argName }}

This placeholder indicates where the user input should be substituted when the command is executed.

Using Arguments in Commands

When invoking a command that includes arguments, you must specify the argument values in the command line. These values will replace the corresponding placeholders in the command at runtime.

Consider a command that is designed to establish a connection. The command might look like this in the command definition:

connection command --myArgument {{ myArgument }}

To execute this command with a specific argument, you would enter the following in a trigger environment, such as Slack:

@obot connection command --myArgument 1234

In this example, the value 1234 is provided by the user, and {{ myArgument }} in the command will be replaced with 1234 when the command is run.

Conclusion

Using arguments in commands provides a flexible way to customize workflows based on user input. By following the syntax and best practices outlined above, you can create dynamic and robust commands that adapt to a variety of needs and scenarios.

This functionality not only enhances interactivity but also enables automation processes to be more aligned with user-specific requirements, thereby increasing the overall efficiency and effectiveness of your OpsBeacon Platform.

Previous
How to add AWS Cross Account Role