solution Use Case
DataMiner ChatOps: tables, forms, and commands with Adaptive Cards
With the DataMiner Teams bot, you can interact with your DataMiner System in Microsoft Teams. Additionally, you can create your own custom commands to interact with your DMS, a great feature that leverages DataMiner Automation and the power of C# for a myriad of possibilities.
One notable feature is the integration with Adaptive Cards .NET SDK, a powerful way of setting up communication between Teams and DataMiner. With Adaptive Cards, you can display data in different formats, create interactive forms, and execute commands. Leveraging C# within your Automation scripts allows for complete customization of Adaptive Cards, empowering you to tailor card layouts and actions to your specific needs.
For instance, by incorporating an “AdaptiveActionSet” in your C# code, you can add buttons to the Adaptive Cards. These buttons serve as intuitive triggers for actions within the DataMiner System, such as claiming ownership of alarms with a single click.
This use case demonstrates the process of modifying C# code within your Automation scripts to accomplish specific objectives. In this scenario, leveraging this functionality, the Teams bot triggers commands with form data to communicate with DataMiner’s Scheduler, facilitating tasks such as managing EC2 instances on AWS and controlling power distribution units from vendors like Intellinet and Brennenstuhl.
Learn how to create your own custom commands for the Teams bot:
USE CASE DETAILS
In this example, an Adaptive Card is used to look into the status of EC2 instances. The table and form in the Adaptive Card are dynamically generated based on the content of the element’s table. Initially, the form triggers a command to start EC2 instances. Then, the same command runs again, creating a scheduled script execution by using DataMiner’s Scheduler to stop them later. Finally, the status of each instance is displayed by triggering another command.
Using "AdaptiveTable" in your C# code lets you show element data in a table. You can display the EC2 state with different colors using "AdaptiveTextColor" or "AdaptiveContainerStyle", and you can also toggle subcards by defining them as their own Adaptive Card and displaying them using an "AdaptiveShowCardAction".
To create forms, use "AdaptiveChoiceSetInput" and enable multiple selections by setting the "IsMultiSelect" boolean. You can even opt for enforced multiple selections by setting "IsRequired" to "true". To incorporate a dropdown menu, use "AdaptiveChoiceInputStyle". Pass your form data to another script that you can trigger with an "AdaptiveSubmitAction" button, allowing seamless switching between different chatbot commands and creating command chains.
When you use "AdaptiveDateInput" and "AdaptiveTimeInput" together with the "IDmsScheduler" interface, you can run scripts on a schedule.
Here's another application of the DataMiner Teams bot: displaying outlet statuses and letting you switch the connection of a power distribution unit with one click. This data is retrieved from a self-developed HTTP connector for this specific Intellinet PDU device.
DataMiner's vendor-independent nature lets you replicate a similar look and feel with devices from different vendors, such as this Brennenstuhl PDU, which employs a custom connector with SNMP and HTTP communication.
1 thought on “DataMiner ChatOps: tables, forms, and commands with Adaptive Cards”
Leave a Reply
You must be logged in to post a comment.
Really nice use case! Love to see this functionality being leveraged properly.